/* Include files */

#include "kalman2_sfun.h"
#include "c2_kalman2.h"
#include "mwmathutil.h"
#define CHARTINSTANCE_CHARTNUMBER      (chartInstance.chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER   (chartInstance.instanceNumber)
#include "kalman2_sfun_debug_macros.h"

/* Type Definitions */

/* Named Constants */
#define c2_IN_NO_ACTIVE_CHILD          (0)

/* Variable Declarations */

/* Variable Definitions */
static SFc2_kalman2InstanceStruct chartInstance;

/* Function Declarations */
static void initialize_c2_kalman2(void);
static void initialize_params_c2_kalman2(void);
static void enable_c2_kalman2(void);
static void disable_c2_kalman2(void);
static void update_debugger_state_c2_kalman2(void);
static const mxArray *get_sim_state_c2_kalman2(void);
static void set_sim_state_c2_kalman2(const mxArray *c2_st);
static void finalize_c2_kalman2(void);
static void sf_c2_kalman2(void);
static void c2_c2_kalman2(void);
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
  c2_chartNumber);
static real_T c2_norm(real_T c2_x);
static real_T c2_abs(real_T c2_x);
static real_T c2_b_norm(real_T c2_x[9]);
static void c2_svd(real_T c2_A[9], real_T c2_Uout[3]);
static boolean_T c2_isfinite(real_T c2_x);
static void c2_eml_error(void);
static void c2_eml_zeros(real_T c2_x[3]);
static void c2_b_eml_zeros(real_T c2_x[3]);
static real_T c2_eml_xnrm2(int32_T c2_n, real_T c2_x[9], int32_T c2_ix0);
static void c2_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[9], int32_T
  c2_ix0, real_T c2_b_x[9]);
static real_T c2_eml_xdotc(int32_T c2_n, real_T c2_x[9], int32_T c2_ix0, real_T
  c2_y[9], int32_T c2_iy0);
static void c2_eml_xaxpy(int32_T c2_n, real_T c2_a, int32_T c2_ix0, real_T c2_y
  [9], int32_T c2_iy0, real_T c2_b_y[9]);
static real_T c2_b_eml_xnrm2(int32_T c2_n, real_T c2_x[3], int32_T c2_ix0);
static void c2_b_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_b_x[3]);
static void c2_b_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[9], int32_T
  c2_ix0, real_T c2_y[3], int32_T c2_iy0, real_T c2_b_y[3]);
static void c2_c_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_y[9], int32_T c2_iy0, real_T c2_b_y[9]);
static void c2_b_eml_error(void);
static real_T c2_max(real_T c2_varargin_1, real_T c2_varargin_2);
static void c2_c_eml_error(void);
static real_T c2_b_max(real_T c2_varargin_1[5]);
static real_T c2_sqrt(real_T c2_x);
static void c2_d_eml_error(void);
static void c2_eml_xrotg(real_T c2_a, real_T c2_b, real_T *c2_b_a, real_T
  *c2_b_b, real_T *c2_c, real_T *c2_s);
static void c2_eml_warning(void);
static real_T c2_c_norm(real_T c2_x[3]);
static real_T c2_genpnorm(real_T c2_x[3], real_T c2_p);
static real_T c2_c_eml_xnrm2(real_T c2_x[3]);
static real_T c2_mpower(real_T c2_a, real_T c2_b);
static real_T c2_d_norm(real_T c2_x[6]);
static void c2_b_svd(real_T c2_A[6], real_T c2_Uout[2]);
static void c2_c_eml_zeros(real_T c2_x[3]);
static void c2_d_eml_zeros(real_T c2_x[2]);
static real_T c2_d_eml_xnrm2(int32_T c2_n, real_T c2_x[6], int32_T c2_ix0);
static void c2_c_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[6], int32_T
  c2_ix0, real_T c2_b_x[6]);
static real_T c2_b_eml_xdotc(int32_T c2_n, real_T c2_x[6], int32_T c2_ix0,
  real_T c2_y[6], int32_T c2_iy0);
static void c2_d_eml_xaxpy(int32_T c2_n, real_T c2_a, int32_T c2_ix0, real_T
  c2_y[6], int32_T c2_iy0, real_T c2_b_y[6]);
static real_T c2_e_eml_xnrm2(int32_T c2_n, real_T c2_x[2], int32_T c2_ix0);
static void c2_d_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[2], int32_T
  c2_ix0, real_T c2_b_x[2]);
static void c2_e_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[6], int32_T
  c2_ix0, real_T c2_y[3], int32_T c2_iy0, real_T c2_b_y[3]);
static void c2_f_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_y[6], int32_T c2_iy0, real_T c2_b_y[6]);
static real_T c2_e_norm(real_T c2_x[3]);
static real_T c2_b_genpnorm(real_T c2_x[3], real_T c2_p);
static real_T c2_f_eml_xnrm2(real_T c2_x[3]);
static real_T c2_f_norm(real_T c2_x[2]);
static real_T c2_c_genpnorm(real_T c2_x[2], real_T c2_p);
static real_T c2_g_eml_xnrm2(real_T c2_x[2]);
static real_T c2_g_norm(real_T c2_x[4]);
static void c2_c_svd(real_T c2_A[4], real_T c2_Uout[2]);
static void c2_e_eml_zeros(real_T c2_x[2]);
static void c2_f_eml_zeros(real_T c2_x[2]);
static real_T c2_h_eml_xnrm2(real_T c2_x[4]);
static void c2_e_eml_xscal(real_T c2_a, real_T c2_x[4], real_T c2_b_x[4]);
static real_T c2_c_eml_xdotc(real_T c2_x[4], real_T c2_y[4]);
static void c2_g_eml_xaxpy(real_T c2_a, real_T c2_y[4], real_T c2_b_y[4]);
static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_c_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_d_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_e_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_f_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_g_sf_marshall(void *c2_chartInstance, void *c2_u);
static void c2_info_helper(c2_ResolvedFunctionInfo c2_info[107]);
static void c2_b_info_helper(c2_ResolvedFunctionInfo c2_info[107]);
static void init_dsm_address_info(void);

/* Function Definitions */
static void initialize_c2_kalman2(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  chartInstance.c2_is_active_c2_kalman2 = 0U;
}

static void initialize_params_c2_kalman2(void)
{
}

static void enable_c2_kalman2(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
}

static void disable_c2_kalman2(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
}

static void update_debugger_state_c2_kalman2(void)
{
}

static const mxArray *get_sim_state_c2_kalman2(void)
{
  return NULL;
}

static void set_sim_state_c2_kalman2(const mxArray *c2_st)
{
  sf_mex_destroy(&c2_st);
}

static void finalize_c2_kalman2(void)
{
}

static void sf_c2_kalman2(void)
{
  int32_T c2_i0;
  int32_T c2_i1;
  int32_T c2_i2;
  int32_T c2_i3;
  int32_T c2_i4;
  int32_T c2_i5;
  int32_T c2_i6;
  int32_T c2_i7;
  int32_T c2_i8;
  int32_T c2_i9;
  uint8_T c2_previousEvent;
  real_T *c2_u;
  real_T *c2_D;
  real_T *c2_R;
  real_T *c2_y;
  real_T (*c2_Pkplus1)[9];
  real_T (*c2_Pk)[9];
  real_T (*c2_xk)[3];
  real_T (*c2_Q)[4];
  real_T (*c2_H)[2];
  real_T (*c2_C)[3];
  real_T (*c2_G)[6];
  real_T (*c2_Gamma)[3];
  real_T (*c2_Phi)[9];
  real_T (*c2_xkplus1)[3];
  c2_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c2_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
  c2_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
  c2_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
  c2_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c2_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
  c2_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
  c2_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
  c2_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
  c2_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
  c2_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
  c2_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
  c2_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
  c2_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,0);
  _SFD_DATA_RANGE_CHECK(*c2_u, 0U);
  for (c2_i0 = 0; c2_i0 < 3; c2_i0 = c2_i0 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_xkplus1)[c2_i0], 1U);
  }

  for (c2_i1 = 0; c2_i1 < 9; c2_i1 = c2_i1 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Phi)[c2_i1], 2U);
  }

  for (c2_i2 = 0; c2_i2 < 3; c2_i2 = c2_i2 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Gamma)[c2_i2], 3U);
  }

  for (c2_i3 = 0; c2_i3 < 6; c2_i3 = c2_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_G)[c2_i3], 4U);
  }

  for (c2_i4 = 0; c2_i4 < 3; c2_i4 = c2_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_C)[c2_i4], 5U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_D, 6U);
  for (c2_i5 = 0; c2_i5 < 2; c2_i5 = c2_i5 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_H)[c2_i5], 7U);
  }

  for (c2_i6 = 0; c2_i6 < 4; c2_i6 = c2_i6 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Q)[c2_i6], 8U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_R, 9U);
  for (c2_i7 = 0; c2_i7 < 3; c2_i7 = c2_i7 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_xk)[c2_i7], 10U);
  }

  for (c2_i8 = 0; c2_i8 < 9; c2_i8 = c2_i8 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Pk)[c2_i8], 11U);
  }

  for (c2_i9 = 0; c2_i9 < 9; c2_i9 = c2_i9 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Pkplus1)[c2_i9], 12U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_y, 13U);
  c2_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c2_c2_kalman2();
  _sfEvent_ = c2_previousEvent;
  sf_debug_check_for_state_inconsistency(_kalman2MachineNumber_,
    chartInstance.chartNumber, chartInstance.instanceNumber);
}

static void c2_c2_kalman2(void)
{
  real_T c2_u;
  int32_T c2_i10;
  real_T c2_Phi[9];
  int32_T c2_i11;
  real_T c2_Gamma[3];
  int32_T c2_i12;
  real_T c2_G[6];
  int32_T c2_i13;
  real_T c2_C[3];
  real_T c2_D;
  int32_T c2_i14;
  real_T c2_H[2];
  int32_T c2_i15;
  real_T c2_Q[4];
  real_T c2_R;
  int32_T c2_i16;
  real_T c2_xk[3];
  int32_T c2_i17;
  real_T c2_Pk[9];
  real_T c2_y;
  real_T c2_nargout = 2.0;
  real_T c2_nargin = 12.0;
  real_T c2_K[3];
  real_T c2_Pkplus1[9];
  real_T c2_xkplus1[3];
  int32_T c2_i18;
  real_T c2_b_Phi[9];
  int32_T c2_i19;
  real_T c2_b_Gamma[3];
  int32_T c2_i20;
  real_T c2_b_G[6];
  int32_T c2_i21;
  real_T c2_b_C[3];
  int32_T c2_i22;
  real_T c2_b_H[2];
  int32_T c2_i23;
  real_T c2_b_Q[4];
  int32_T c2_i24;
  int32_T c2_i25;
  int32_T c2_i26;
  real_T c2_a[9];
  int32_T c2_i27;
  real_T c2_b[9];
  int32_T c2_i28;
  real_T c2_A[9];
  int32_T c2_i29;
  real_T c2_B[9];
  int32_T c2_i30;
  real_T c2_b_A[9];
  int32_T c2_i31;
  real_T c2_b_B[9];
  int32_T c2_i32;
  real_T c2_c_A[9];
  int32_T c2_i33;
  real_T c2_c_B[9];
  int32_T c2_i34;
  int32_T c2_i35;
  real_T c2_b_a[9];
  int32_T c2_i36;
  int32_T c2_i37;
  real_T c2_b_b[3];
  int32_T c2_i38;
  real_T c2_d_A[9];
  int32_T c2_i39;
  real_T c2_d_B[3];
  int32_T c2_i40;
  real_T c2_e_A[9];
  int32_T c2_i41;
  real_T c2_e_B[3];
  int32_T c2_i42;
  real_T c2_f_A[9];
  int32_T c2_i43;
  real_T c2_f_B[3];
  int32_T c2_i44;
  real_T c2_c_a[3];
  int32_T c2_i45;
  int32_T c2_i46;
  real_T c2_d_a[2];
  int32_T c2_i47;
  real_T c2_c_b[4];
  int32_T c2_i48;
  real_T c2_g_A[2];
  int32_T c2_i49;
  real_T c2_g_B[4];
  int32_T c2_i50;
  real_T c2_h_A[2];
  int32_T c2_i51;
  real_T c2_h_B[4];
  int32_T c2_i52;
  real_T c2_i_A[2];
  int32_T c2_i53;
  real_T c2_i_B[4];
  int32_T c2_i54;
  real_T c2_e_a[2];
  int32_T c2_i55;
  int32_T c2_i56;
  real_T c2_d_b[2];
  int32_T c2_i57;
  real_T c2_x[2];
  int32_T c2_i58;
  real_T c2_b_y[2];
  int32_T c2_i59;
  real_T c2_b_x[2];
  int32_T c2_i60;
  real_T c2_c_y[2];
  int32_T c2_i61;
  real_T c2_c_x[2];
  int32_T c2_i62;
  real_T c2_d_y[2];
  int32_T c2_i63;
  real_T c2_d_x[2];
  int32_T c2_i64;
  real_T c2_e_y[2];
  int32_T c2_i65;
  real_T c2_e_x[2];
  int32_T c2_i66;
  real_T c2_f_y[2];
  real_T c2_g_y;
  int32_T c2_k;
  int32_T c2_b_k;
  int32_T c2_i67;
  real_T c2_f_a[3];
  int32_T c2_i68;
  real_T c2_e_b[9];
  int32_T c2_i69;
  real_T c2_j_A[3];
  int32_T c2_i70;
  real_T c2_j_B[9];
  int32_T c2_i71;
  real_T c2_k_A[3];
  int32_T c2_i72;
  real_T c2_k_B[9];
  int32_T c2_i73;
  real_T c2_l_A[3];
  int32_T c2_i74;
  real_T c2_l_B[9];
  int32_T c2_i75;
  real_T c2_g_a[3];
  int32_T c2_i76;
  int32_T c2_i77;
  real_T c2_f_b[3];
  int32_T c2_i78;
  real_T c2_f_x[3];
  int32_T c2_i79;
  real_T c2_h_y[3];
  int32_T c2_i80;
  real_T c2_g_x[3];
  int32_T c2_i81;
  real_T c2_i_y[3];
  int32_T c2_i82;
  real_T c2_h_x[3];
  int32_T c2_i83;
  real_T c2_j_y[3];
  int32_T c2_i84;
  real_T c2_i_x[3];
  int32_T c2_i85;
  real_T c2_k_y[3];
  int32_T c2_i86;
  real_T c2_j_x[3];
  int32_T c2_i87;
  real_T c2_l_y[3];
  real_T c2_m_y;
  int32_T c2_c_k;
  int32_T c2_d_k;
  real_T c2_g_b;
  int32_T c2_i88;
  int32_T c2_i89;
  real_T c2_h_a[3];
  real_T c2_i_a;
  real_T c2_h_b;
  real_T c2_n_y;
  int32_T c2_i90;
  real_T c2_j_a[3];
  int32_T c2_i91;
  real_T c2_i_b[3];
  int32_T c2_i92;
  real_T c2_k_x[3];
  int32_T c2_i93;
  real_T c2_o_y[3];
  int32_T c2_i94;
  real_T c2_l_x[3];
  int32_T c2_i95;
  real_T c2_p_y[3];
  int32_T c2_i96;
  real_T c2_m_x[3];
  int32_T c2_i97;
  real_T c2_q_y[3];
  int32_T c2_i98;
  real_T c2_n_x[3];
  int32_T c2_i99;
  real_T c2_r_y[3];
  int32_T c2_i100;
  real_T c2_o_x[3];
  int32_T c2_i101;
  real_T c2_s_y[3];
  real_T c2_t_y;
  int32_T c2_e_k;
  int32_T c2_f_k;
  real_T c2_j_b;
  int32_T c2_i102;
  real_T c2_u_y[3];
  int32_T c2_i103;
  real_T c2_k_a[3];
  real_T c2_k_b;
  int32_T c2_i104;
  real_T c2_v_y[3];
  int32_T c2_i105;
  real_T c2_l_a[9];
  int32_T c2_i106;
  real_T c2_l_b[3];
  int32_T c2_i107;
  real_T c2_m_A[9];
  int32_T c2_i108;
  real_T c2_m_B[3];
  int32_T c2_i109;
  real_T c2_n_A[9];
  int32_T c2_i110;
  real_T c2_n_B[3];
  int32_T c2_i111;
  real_T c2_o_A[9];
  int32_T c2_i112;
  real_T c2_o_B[3];
  int32_T c2_i113;
  real_T c2_w_y[3];
  int32_T c2_i114;
  int32_T c2_i115;
  int32_T c2_i116;
  real_T c2_m_a[3];
  int32_T c2_i117;
  real_T c2_m_b[3];
  int32_T c2_i118;
  int32_T c2_i119;
  real_T c2_n_a[9];
  int32_T c2_i120;
  real_T c2_n_b[9];
  int32_T c2_i121;
  real_T c2_p_A[9];
  int32_T c2_i122;
  real_T c2_p_B[9];
  int32_T c2_i123;
  real_T c2_q_A[9];
  int32_T c2_i124;
  real_T c2_q_B[9];
  int32_T c2_i125;
  real_T c2_r_A[9];
  int32_T c2_i126;
  real_T c2_r_B[9];
  int32_T c2_i127;
  int32_T c2_i128;
  real_T c2_o_a[9];
  int32_T c2_i129;
  int32_T c2_i130;
  int32_T c2_i131;
  real_T c2_o_b[9];
  int32_T c2_i132;
  real_T c2_s_A[9];
  int32_T c2_i133;
  real_T c2_s_B[9];
  int32_T c2_i134;
  real_T c2_t_A[9];
  int32_T c2_i135;
  real_T c2_t_B[9];
  int32_T c2_i136;
  real_T c2_u_A[9];
  int32_T c2_i137;
  real_T c2_u_B[9];
  int32_T c2_i138;
  int32_T c2_i139;
  real_T c2_x_y[9];
  int32_T c2_i140;
  int32_T c2_i141;
  real_T c2_p_a[6];
  int32_T c2_i142;
  real_T c2_p_b[4];
  int32_T c2_i143;
  real_T c2_v_A[6];
  int32_T c2_i144;
  real_T c2_v_B[4];
  int32_T c2_i145;
  real_T c2_w_A[6];
  int32_T c2_i146;
  real_T c2_w_B[4];
  int32_T c2_i147;
  real_T c2_x_A[6];
  int32_T c2_i148;
  real_T c2_x_B[4];
  int32_T c2_i149;
  int32_T c2_i150;
  real_T c2_q_a[6];
  int32_T c2_i151;
  int32_T c2_i152;
  int32_T c2_i153;
  real_T c2_q_b[6];
  int32_T c2_i154;
  real_T c2_y_A[6];
  int32_T c2_i155;
  real_T c2_y_B[6];
  int32_T c2_i156;
  real_T c2_ab_A[6];
  int32_T c2_i157;
  real_T c2_ab_B[6];
  int32_T c2_i158;
  real_T c2_bb_A[6];
  int32_T c2_i159;
  real_T c2_bb_B[6];
  int32_T c2_i160;
  int32_T c2_i161;
  real_T c2_y_y[9];
  int32_T c2_i162;
  int32_T c2_i163;
  real_T c2_r_a[9];
  int32_T c2_i164;
  real_T c2_r_b[9];
  int32_T c2_i165;
  real_T c2_cb_A[9];
  int32_T c2_i166;
  real_T c2_cb_B[9];
  int32_T c2_i167;
  real_T c2_db_A[9];
  int32_T c2_i168;
  real_T c2_db_B[9];
  int32_T c2_i169;
  real_T c2_eb_A[9];
  int32_T c2_i170;
  real_T c2_eb_B[9];
  int32_T c2_i171;
  int32_T c2_i172;
  real_T c2_s_a[9];
  int32_T c2_i173;
  int32_T c2_i174;
  int32_T c2_i175;
  real_T c2_s_b[9];
  int32_T c2_i176;
  real_T c2_fb_A[9];
  int32_T c2_i177;
  real_T c2_fb_B[9];
  int32_T c2_i178;
  real_T c2_gb_A[9];
  int32_T c2_i179;
  real_T c2_gb_B[9];
  int32_T c2_i180;
  real_T c2_hb_A[9];
  int32_T c2_i181;
  real_T c2_hb_B[9];
  int32_T c2_i182;
  int32_T c2_i183;
  real_T c2_ab_y[9];
  int32_T c2_i184;
  int32_T c2_i185;
  int32_T c2_i186;
  int32_T c2_i187;
  real_T *c2_bb_y;
  real_T *c2_b_R;
  real_T *c2_b_D;
  real_T *c2_b_u;
  real_T (*c2_b_xkplus1)[3];
  real_T (*c2_b_Pkplus1)[9];
  real_T (*c2_b_Pk)[9];
  real_T (*c2_b_xk)[3];
  real_T (*c2_c_Q)[4];
  real_T (*c2_c_H)[2];
  real_T (*c2_c_C)[3];
  real_T (*c2_c_G)[6];
  real_T (*c2_c_Gamma)[3];
  real_T (*c2_c_Phi)[9];
  c2_b_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c2_c_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
  c2_c_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
  c2_bb_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
  c2_b_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c2_c_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
  c2_b_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
  c2_b_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
  c2_c_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
  c2_c_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
  c2_b_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
  c2_c_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
  c2_b_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
  c2_b_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,0);
  c2_u = *c2_b_u;
  for (c2_i10 = 0; c2_i10 < 9; c2_i10 = c2_i10 + 1) {
    c2_Phi[c2_i10] = (*c2_c_Phi)[c2_i10];
  }

  for (c2_i11 = 0; c2_i11 < 3; c2_i11 = c2_i11 + 1) {
    c2_Gamma[c2_i11] = (*c2_c_Gamma)[c2_i11];
  }

  for (c2_i12 = 0; c2_i12 < 6; c2_i12 = c2_i12 + 1) {
    c2_G[c2_i12] = (*c2_c_G)[c2_i12];
  }

  for (c2_i13 = 0; c2_i13 < 3; c2_i13 = c2_i13 + 1) {
    c2_C[c2_i13] = (*c2_c_C)[c2_i13];
  }

  c2_D = *c2_b_D;
  for (c2_i14 = 0; c2_i14 < 2; c2_i14 = c2_i14 + 1) {
    c2_H[c2_i14] = (*c2_c_H)[c2_i14];
  }

  for (c2_i15 = 0; c2_i15 < 4; c2_i15 = c2_i15 + 1) {
    c2_Q[c2_i15] = (*c2_c_Q)[c2_i15];
  }

  c2_R = *c2_b_R;
  for (c2_i16 = 0; c2_i16 < 3; c2_i16 = c2_i16 + 1) {
    c2_xk[c2_i16] = (*c2_b_xk)[c2_i16];
  }

  for (c2_i17 = 0; c2_i17 < 9; c2_i17 = c2_i17 + 1) {
    c2_Pk[c2_i17] = (*c2_b_Pk)[c2_i17];
  }

  c2_y = *c2_bb_y;
  sf_debug_symbol_scope_push(17U, 0U);
  sf_debug_symbol_scope_add("nargout", &c2_nargout, c2_sf_marshall);
  sf_debug_symbol_scope_add("nargin", &c2_nargin, c2_sf_marshall);
  sf_debug_symbol_scope_add("K", &c2_K, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("Pkplus1", &c2_Pkplus1, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("xkplus1", &c2_xkplus1, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("y", &c2_y, c2_sf_marshall);
  sf_debug_symbol_scope_add("Pk", &c2_Pk, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("xk", &c2_xk, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("R", &c2_R, c2_sf_marshall);
  sf_debug_symbol_scope_add("Q", &c2_Q, c2_g_sf_marshall);
  sf_debug_symbol_scope_add("H", &c2_H, c2_f_sf_marshall);
  sf_debug_symbol_scope_add("D", &c2_D, c2_sf_marshall);
  sf_debug_symbol_scope_add("C", &c2_C, c2_e_sf_marshall);
  sf_debug_symbol_scope_add("G", &c2_G, c2_d_sf_marshall);
  sf_debug_symbol_scope_add("Gamma", &c2_Gamma, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("Phi", &c2_Phi, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("u", &c2_u, c2_sf_marshall);
  CV_EML_FCN(0, 0);

  /*  This block supports the Embedded MATLAB subset. */
  /*  See the help menu for details.  */
  _SFD_EML_CALL(0,5);
  for (c2_i18 = 0; c2_i18 < 9; c2_i18 = c2_i18 + 1) {
    c2_b_Phi[c2_i18] = c2_Phi[c2_i18];
  }

  for (c2_i19 = 0; c2_i19 < 3; c2_i19 = c2_i19 + 1) {
    c2_b_Gamma[c2_i19] = c2_Gamma[c2_i19];
  }

  for (c2_i20 = 0; c2_i20 < 6; c2_i20 = c2_i20 + 1) {
    c2_b_G[c2_i20] = c2_G[c2_i20];
  }

  for (c2_i21 = 0; c2_i21 < 3; c2_i21 = c2_i21 + 1) {
    c2_b_C[c2_i21] = c2_C[c2_i21];
  }

  for (c2_i22 = 0; c2_i22 < 2; c2_i22 = c2_i22 + 1) {
    c2_b_H[c2_i22] = c2_H[c2_i22];
  }

  for (c2_i23 = 0; c2_i23 < 4; c2_i23 = c2_i23 + 1) {
    c2_b_Q[c2_i23] = c2_Q[c2_i23];
  }

  if (CV_EML_IF(0, 0, (((((((c2_norm(c2_u) + c2_b_norm(c2_b_Phi)) + c2_c_norm
             (c2_b_Gamma)) + c2_d_norm(c2_b_G)) + c2_e_norm(c2_b_C)) +
          c2_norm(c2_D)) + c2_f_norm(c2_b_H)) + c2_g_norm(c2_b_Q)) + c2_norm
                (c2_R) < c2_mpower(10.0, -6.0))) {
    _SFD_EML_CALL(0,6);
    for (c2_i24 = 0; c2_i24 < 3; c2_i24 = c2_i24 + 1) {
      c2_xkplus1[c2_i24] = c2_xk[c2_i24];
    }

    _SFD_EML_CALL(0,7);
    for (c2_i25 = 0; c2_i25 < 9; c2_i25 = c2_i25 + 1) {
      c2_Pkplus1[c2_i25] = c2_Pk[c2_i25];
    }
  } else {
    _SFD_EML_CALL(0,9);
    for (c2_i26 = 0; c2_i26 < 9; c2_i26 = c2_i26 + 1) {
      c2_a[c2_i26] = c2_Phi[c2_i26];
    }

    for (c2_i27 = 0; c2_i27 < 9; c2_i27 = c2_i27 + 1) {
      c2_b[c2_i27] = c2_Pk[c2_i27];
    }

    for (c2_i28 = 0; c2_i28 < 9; c2_i28 = c2_i28 + 1) {
      c2_A[c2_i28] = c2_a[c2_i28];
    }

    for (c2_i29 = 0; c2_i29 < 9; c2_i29 = c2_i29 + 1) {
      c2_B[c2_i29] = c2_b[c2_i29];
    }

    for (c2_i30 = 0; c2_i30 < 9; c2_i30 = c2_i30 + 1) {
      c2_b_A[c2_i30] = c2_A[c2_i30];
    }

    for (c2_i31 = 0; c2_i31 < 9; c2_i31 = c2_i31 + 1) {
      c2_b_B[c2_i31] = c2_B[c2_i31];
    }

    for (c2_i32 = 0; c2_i32 < 9; c2_i32 = c2_i32 + 1) {
      c2_c_A[c2_i32] = c2_b_A[c2_i32];
    }

    for (c2_i33 = 0; c2_i33 < 9; c2_i33 = c2_i33 + 1) {
      c2_c_B[c2_i33] = c2_b_B[c2_i33];
    }

    for (c2_i34 = 0; c2_i34 < 3; c2_i34 = c2_i34 + 1) {
      for (c2_i35 = 0; c2_i35 < 3; c2_i35 = c2_i35 + 1) {
        c2_b_a[c2_i34 + 3 * c2_i35] = 0.0;
        for (c2_i36 = 0; c2_i36 < 3; c2_i36 = c2_i36 + 1) {
          c2_b_a[c2_i34 + 3 * c2_i35] = c2_b_a[c2_i34 + 3 * c2_i35] +
            c2_c_A[c2_i34 + 3 * c2_i36] * c2_c_B[c2_i36 + 3 * c2_i35];
        }
      }
    }

    for (c2_i37 = 0; c2_i37 < 3; c2_i37 = c2_i37 + 1) {
      c2_b_b[c2_i37] = c2_C[c2_i37];
    }

    for (c2_i38 = 0; c2_i38 < 9; c2_i38 = c2_i38 + 1) {
      c2_d_A[c2_i38] = c2_b_a[c2_i38];
    }

    for (c2_i39 = 0; c2_i39 < 3; c2_i39 = c2_i39 + 1) {
      c2_d_B[c2_i39] = c2_b_b[c2_i39];
    }

    for (c2_i40 = 0; c2_i40 < 9; c2_i40 = c2_i40 + 1) {
      c2_e_A[c2_i40] = c2_d_A[c2_i40];
    }

    for (c2_i41 = 0; c2_i41 < 3; c2_i41 = c2_i41 + 1) {
      c2_e_B[c2_i41] = c2_d_B[c2_i41];
    }

    for (c2_i42 = 0; c2_i42 < 9; c2_i42 = c2_i42 + 1) {
      c2_f_A[c2_i42] = c2_e_A[c2_i42];
    }

    for (c2_i43 = 0; c2_i43 < 3; c2_i43 = c2_i43 + 1) {
      c2_f_B[c2_i43] = c2_e_B[c2_i43];
    }

    for (c2_i44 = 0; c2_i44 < 3; c2_i44 = c2_i44 + 1) {
      c2_c_a[c2_i44] = 0.0;
      for (c2_i45 = 0; c2_i45 < 3; c2_i45 = c2_i45 + 1) {
        c2_c_a[c2_i44] = c2_c_a[c2_i44] + c2_f_A[c2_i44 + 3 * c2_i45] *
          c2_f_B[c2_i45];
      }
    }

    for (c2_i46 = 0; c2_i46 < 2; c2_i46 = c2_i46 + 1) {
      c2_d_a[c2_i46] = c2_H[c2_i46];
    }

    for (c2_i47 = 0; c2_i47 < 4; c2_i47 = c2_i47 + 1) {
      c2_c_b[c2_i47] = c2_Q[c2_i47];
    }

    for (c2_i48 = 0; c2_i48 < 2; c2_i48 = c2_i48 + 1) {
      c2_g_A[c2_i48] = c2_d_a[c2_i48];
    }

    for (c2_i49 = 0; c2_i49 < 4; c2_i49 = c2_i49 + 1) {
      c2_g_B[c2_i49] = c2_c_b[c2_i49];
    }

    for (c2_i50 = 0; c2_i50 < 2; c2_i50 = c2_i50 + 1) {
      c2_h_A[c2_i50] = c2_g_A[c2_i50];
    }

    for (c2_i51 = 0; c2_i51 < 4; c2_i51 = c2_i51 + 1) {
      c2_h_B[c2_i51] = c2_g_B[c2_i51];
    }

    for (c2_i52 = 0; c2_i52 < 2; c2_i52 = c2_i52 + 1) {
      c2_i_A[c2_i52] = c2_h_A[c2_i52];
    }

    for (c2_i53 = 0; c2_i53 < 4; c2_i53 = c2_i53 + 1) {
      c2_i_B[c2_i53] = c2_h_B[c2_i53];
    }

    for (c2_i54 = 0; c2_i54 < 2; c2_i54 = c2_i54 + 1) {
      c2_e_a[c2_i54] = 0.0;
      for (c2_i55 = 0; c2_i55 < 2; c2_i55 = c2_i55 + 1) {
        c2_e_a[c2_i54] = c2_e_a[c2_i54] + c2_i_A[c2_i55] * c2_i_B[c2_i55 + 2 *
          c2_i54];
      }
    }

    for (c2_i56 = 0; c2_i56 < 2; c2_i56 = c2_i56 + 1) {
      c2_d_b[c2_i56] = c2_H[c2_i56];
    }

    for (c2_i57 = 0; c2_i57 < 2; c2_i57 = c2_i57 + 1) {
      c2_x[c2_i57] = c2_e_a[c2_i57];
    }

    for (c2_i58 = 0; c2_i58 < 2; c2_i58 = c2_i58 + 1) {
      c2_b_y[c2_i58] = c2_d_b[c2_i58];
    }

    for (c2_i59 = 0; c2_i59 < 2; c2_i59 = c2_i59 + 1) {
      c2_b_x[c2_i59] = c2_x[c2_i59];
    }

    for (c2_i60 = 0; c2_i60 < 2; c2_i60 = c2_i60 + 1) {
      c2_c_y[c2_i60] = c2_b_y[c2_i60];
    }

    for (c2_i61 = 0; c2_i61 < 2; c2_i61 = c2_i61 + 1) {
      c2_c_x[c2_i61] = c2_b_x[c2_i61];
    }

    for (c2_i62 = 0; c2_i62 < 2; c2_i62 = c2_i62 + 1) {
      c2_d_y[c2_i62] = c2_c_y[c2_i62];
    }

    for (c2_i63 = 0; c2_i63 < 2; c2_i63 = c2_i63 + 1) {
      c2_d_x[c2_i63] = c2_c_x[c2_i63];
    }

    for (c2_i64 = 0; c2_i64 < 2; c2_i64 = c2_i64 + 1) {
      c2_e_y[c2_i64] = c2_d_y[c2_i64];
    }

    for (c2_i65 = 0; c2_i65 < 2; c2_i65 = c2_i65 + 1) {
      c2_e_x[c2_i65] = c2_d_x[c2_i65];
    }

    for (c2_i66 = 0; c2_i66 < 2; c2_i66 = c2_i66 + 1) {
      c2_f_y[c2_i66] = c2_e_y[c2_i66];
    }

    c2_g_y = 0.0;
    for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
      c2_b_k = c2_k;
      c2_g_y = c2_g_y + c2_e_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x",
        _SFD_INTEGER_CHECK("k", (real_T)c2_b_k), 1, 2, 1, 0) - 1] * c2_f_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
        1, 2, 1, 0) - 1];
    }

    for (c2_i67 = 0; c2_i67 < 3; c2_i67 = c2_i67 + 1) {
      c2_f_a[c2_i67] = c2_C[c2_i67];
    }

    for (c2_i68 = 0; c2_i68 < 9; c2_i68 = c2_i68 + 1) {
      c2_e_b[c2_i68] = c2_Pk[c2_i68];
    }

    for (c2_i69 = 0; c2_i69 < 3; c2_i69 = c2_i69 + 1) {
      c2_j_A[c2_i69] = c2_f_a[c2_i69];
    }

    for (c2_i70 = 0; c2_i70 < 9; c2_i70 = c2_i70 + 1) {
      c2_j_B[c2_i70] = c2_e_b[c2_i70];
    }

    for (c2_i71 = 0; c2_i71 < 3; c2_i71 = c2_i71 + 1) {
      c2_k_A[c2_i71] = c2_j_A[c2_i71];
    }

    for (c2_i72 = 0; c2_i72 < 9; c2_i72 = c2_i72 + 1) {
      c2_k_B[c2_i72] = c2_j_B[c2_i72];
    }

    for (c2_i73 = 0; c2_i73 < 3; c2_i73 = c2_i73 + 1) {
      c2_l_A[c2_i73] = c2_k_A[c2_i73];
    }

    for (c2_i74 = 0; c2_i74 < 9; c2_i74 = c2_i74 + 1) {
      c2_l_B[c2_i74] = c2_k_B[c2_i74];
    }

    for (c2_i75 = 0; c2_i75 < 3; c2_i75 = c2_i75 + 1) {
      c2_g_a[c2_i75] = 0.0;
      for (c2_i76 = 0; c2_i76 < 3; c2_i76 = c2_i76 + 1) {
        c2_g_a[c2_i75] = c2_g_a[c2_i75] + c2_l_A[c2_i76] * c2_l_B[c2_i76 + 3 *
          c2_i75];
      }
    }

    for (c2_i77 = 0; c2_i77 < 3; c2_i77 = c2_i77 + 1) {
      c2_f_b[c2_i77] = c2_C[c2_i77];
    }

    for (c2_i78 = 0; c2_i78 < 3; c2_i78 = c2_i78 + 1) {
      c2_f_x[c2_i78] = c2_g_a[c2_i78];
    }

    for (c2_i79 = 0; c2_i79 < 3; c2_i79 = c2_i79 + 1) {
      c2_h_y[c2_i79] = c2_f_b[c2_i79];
    }

    for (c2_i80 = 0; c2_i80 < 3; c2_i80 = c2_i80 + 1) {
      c2_g_x[c2_i80] = c2_f_x[c2_i80];
    }

    for (c2_i81 = 0; c2_i81 < 3; c2_i81 = c2_i81 + 1) {
      c2_i_y[c2_i81] = c2_h_y[c2_i81];
    }

    for (c2_i82 = 0; c2_i82 < 3; c2_i82 = c2_i82 + 1) {
      c2_h_x[c2_i82] = c2_g_x[c2_i82];
    }

    for (c2_i83 = 0; c2_i83 < 3; c2_i83 = c2_i83 + 1) {
      c2_j_y[c2_i83] = c2_i_y[c2_i83];
    }

    for (c2_i84 = 0; c2_i84 < 3; c2_i84 = c2_i84 + 1) {
      c2_i_x[c2_i84] = c2_h_x[c2_i84];
    }

    for (c2_i85 = 0; c2_i85 < 3; c2_i85 = c2_i85 + 1) {
      c2_k_y[c2_i85] = c2_j_y[c2_i85];
    }

    for (c2_i86 = 0; c2_i86 < 3; c2_i86 = c2_i86 + 1) {
      c2_j_x[c2_i86] = c2_i_x[c2_i86];
    }

    for (c2_i87 = 0; c2_i87 < 3; c2_i87 = c2_i87 + 1) {
      c2_l_y[c2_i87] = c2_k_y[c2_i87];
    }

    c2_m_y = 0.0;
    for (c2_c_k = 1; c2_c_k < 4; c2_c_k = c2_c_k + 1) {
      c2_d_k = c2_c_k;
      c2_m_y = c2_m_y + c2_j_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x",
        _SFD_INTEGER_CHECK("k", (real_T)c2_d_k), 1, 3, 1, 0) - 1] * c2_l_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_d_k),
        1, 3, 1, 0) - 1];
    }

    c2_g_b = c2_mpower((c2_m_y + c2_g_y) + c2_R, -1.0);
    for (c2_i88 = 0; c2_i88 < 3; c2_i88 = c2_i88 + 1) {
      c2_K[c2_i88] = c2_c_a[c2_i88] * c2_g_b;
    }

    _SFD_EML_CALL(0,10);
    for (c2_i89 = 0; c2_i89 < 3; c2_i89 = c2_i89 + 1) {
      c2_h_a[c2_i89] = c2_K[c2_i89];
    }

    c2_i_a = c2_D;
    c2_h_b = c2_u;
    c2_n_y = c2_i_a * c2_h_b;
    for (c2_i90 = 0; c2_i90 < 3; c2_i90 = c2_i90 + 1) {
      c2_j_a[c2_i90] = c2_C[c2_i90];
    }

    for (c2_i91 = 0; c2_i91 < 3; c2_i91 = c2_i91 + 1) {
      c2_i_b[c2_i91] = c2_xk[c2_i91];
    }

    for (c2_i92 = 0; c2_i92 < 3; c2_i92 = c2_i92 + 1) {
      c2_k_x[c2_i92] = c2_j_a[c2_i92];
    }

    for (c2_i93 = 0; c2_i93 < 3; c2_i93 = c2_i93 + 1) {
      c2_o_y[c2_i93] = c2_i_b[c2_i93];
    }

    for (c2_i94 = 0; c2_i94 < 3; c2_i94 = c2_i94 + 1) {
      c2_l_x[c2_i94] = c2_k_x[c2_i94];
    }

    for (c2_i95 = 0; c2_i95 < 3; c2_i95 = c2_i95 + 1) {
      c2_p_y[c2_i95] = c2_o_y[c2_i95];
    }

    for (c2_i96 = 0; c2_i96 < 3; c2_i96 = c2_i96 + 1) {
      c2_m_x[c2_i96] = c2_l_x[c2_i96];
    }

    for (c2_i97 = 0; c2_i97 < 3; c2_i97 = c2_i97 + 1) {
      c2_q_y[c2_i97] = c2_p_y[c2_i97];
    }

    for (c2_i98 = 0; c2_i98 < 3; c2_i98 = c2_i98 + 1) {
      c2_n_x[c2_i98] = c2_m_x[c2_i98];
    }

    for (c2_i99 = 0; c2_i99 < 3; c2_i99 = c2_i99 + 1) {
      c2_r_y[c2_i99] = c2_q_y[c2_i99];
    }

    for (c2_i100 = 0; c2_i100 < 3; c2_i100 = c2_i100 + 1) {
      c2_o_x[c2_i100] = c2_n_x[c2_i100];
    }

    for (c2_i101 = 0; c2_i101 < 3; c2_i101 = c2_i101 + 1) {
      c2_s_y[c2_i101] = c2_r_y[c2_i101];
    }

    c2_t_y = 0.0;
    for (c2_e_k = 1; c2_e_k < 4; c2_e_k = c2_e_k + 1) {
      c2_f_k = c2_e_k;
      c2_t_y = c2_t_y + c2_o_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x",
        _SFD_INTEGER_CHECK("k", (real_T)c2_f_k), 1, 3, 1, 0) - 1] * c2_s_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_f_k),
        1, 3, 1, 0) - 1];
    }

    c2_j_b = (c2_y - c2_t_y) - c2_n_y;
    for (c2_i102 = 0; c2_i102 < 3; c2_i102 = c2_i102 + 1) {
      c2_u_y[c2_i102] = c2_h_a[c2_i102] * c2_j_b;
    }

    for (c2_i103 = 0; c2_i103 < 3; c2_i103 = c2_i103 + 1) {
      c2_k_a[c2_i103] = c2_Gamma[c2_i103];
    }

    c2_k_b = c2_u;
    for (c2_i104 = 0; c2_i104 < 3; c2_i104 = c2_i104 + 1) {
      c2_v_y[c2_i104] = c2_k_a[c2_i104] * c2_k_b;
    }

    for (c2_i105 = 0; c2_i105 < 9; c2_i105 = c2_i105 + 1) {
      c2_l_a[c2_i105] = c2_Phi[c2_i105];
    }

    for (c2_i106 = 0; c2_i106 < 3; c2_i106 = c2_i106 + 1) {
      c2_l_b[c2_i106] = c2_xk[c2_i106];
    }

    for (c2_i107 = 0; c2_i107 < 9; c2_i107 = c2_i107 + 1) {
      c2_m_A[c2_i107] = c2_l_a[c2_i107];
    }

    for (c2_i108 = 0; c2_i108 < 3; c2_i108 = c2_i108 + 1) {
      c2_m_B[c2_i108] = c2_l_b[c2_i108];
    }

    for (c2_i109 = 0; c2_i109 < 9; c2_i109 = c2_i109 + 1) {
      c2_n_A[c2_i109] = c2_m_A[c2_i109];
    }

    for (c2_i110 = 0; c2_i110 < 3; c2_i110 = c2_i110 + 1) {
      c2_n_B[c2_i110] = c2_m_B[c2_i110];
    }

    for (c2_i111 = 0; c2_i111 < 9; c2_i111 = c2_i111 + 1) {
      c2_o_A[c2_i111] = c2_n_A[c2_i111];
    }

    for (c2_i112 = 0; c2_i112 < 3; c2_i112 = c2_i112 + 1) {
      c2_o_B[c2_i112] = c2_n_B[c2_i112];
    }

    for (c2_i113 = 0; c2_i113 < 3; c2_i113 = c2_i113 + 1) {
      c2_w_y[c2_i113] = 0.0;
      for (c2_i114 = 0; c2_i114 < 3; c2_i114 = c2_i114 + 1) {
        c2_w_y[c2_i113] = c2_w_y[c2_i113] + c2_o_A[c2_i113 + 3 * c2_i114] *
          c2_o_B[c2_i114];
      }
    }

    for (c2_i115 = 0; c2_i115 < 3; c2_i115 = c2_i115 + 1) {
      c2_xkplus1[c2_i115] = (c2_w_y[c2_i115] + c2_v_y[c2_i115]) + c2_u_y[c2_i115];
    }

    _SFD_EML_CALL(0,11);
    for (c2_i116 = 0; c2_i116 < 3; c2_i116 = c2_i116 + 1) {
      c2_m_a[c2_i116] = c2_K[c2_i116];
    }

    for (c2_i117 = 0; c2_i117 < 3; c2_i117 = c2_i117 + 1) {
      c2_m_b[c2_i117] = c2_C[c2_i117];
    }

    for (c2_i118 = 0; c2_i118 < 3; c2_i118 = c2_i118 + 1) {
      for (c2_i119 = 0; c2_i119 < 3; c2_i119 = c2_i119 + 1) {
        c2_n_a[c2_i119 + 3 * c2_i118] = c2_m_a[c2_i119] * c2_m_b[c2_i118];
      }
    }

    for (c2_i120 = 0; c2_i120 < 9; c2_i120 = c2_i120 + 1) {
      c2_n_b[c2_i120] = c2_Pk[c2_i120];
    }

    for (c2_i121 = 0; c2_i121 < 9; c2_i121 = c2_i121 + 1) {
      c2_p_A[c2_i121] = c2_n_a[c2_i121];
    }

    for (c2_i122 = 0; c2_i122 < 9; c2_i122 = c2_i122 + 1) {
      c2_p_B[c2_i122] = c2_n_b[c2_i122];
    }

    for (c2_i123 = 0; c2_i123 < 9; c2_i123 = c2_i123 + 1) {
      c2_q_A[c2_i123] = c2_p_A[c2_i123];
    }

    for (c2_i124 = 0; c2_i124 < 9; c2_i124 = c2_i124 + 1) {
      c2_q_B[c2_i124] = c2_p_B[c2_i124];
    }

    for (c2_i125 = 0; c2_i125 < 9; c2_i125 = c2_i125 + 1) {
      c2_r_A[c2_i125] = c2_q_A[c2_i125];
    }

    for (c2_i126 = 0; c2_i126 < 9; c2_i126 = c2_i126 + 1) {
      c2_r_B[c2_i126] = c2_q_B[c2_i126];
    }

    for (c2_i127 = 0; c2_i127 < 3; c2_i127 = c2_i127 + 1) {
      for (c2_i128 = 0; c2_i128 < 3; c2_i128 = c2_i128 + 1) {
        c2_o_a[c2_i127 + 3 * c2_i128] = 0.0;
        for (c2_i129 = 0; c2_i129 < 3; c2_i129 = c2_i129 + 1) {
          c2_o_a[c2_i127 + 3 * c2_i128] = c2_o_a[c2_i127 + 3 * c2_i128] +
            c2_r_A[c2_i127 + 3 * c2_i129] * c2_r_B[c2_i129 + 3 * c2_i128];
        }
      }
    }

    for (c2_i130 = 0; c2_i130 < 3; c2_i130 = c2_i130 + 1) {
      for (c2_i131 = 0; c2_i131 < 3; c2_i131 = c2_i131 + 1) {
        c2_o_b[c2_i131 + 3 * c2_i130] = c2_Phi[c2_i130 + 3 * c2_i131];
      }
    }

    for (c2_i132 = 0; c2_i132 < 9; c2_i132 = c2_i132 + 1) {
      c2_s_A[c2_i132] = c2_o_a[c2_i132];
    }

    for (c2_i133 = 0; c2_i133 < 9; c2_i133 = c2_i133 + 1) {
      c2_s_B[c2_i133] = c2_o_b[c2_i133];
    }

    for (c2_i134 = 0; c2_i134 < 9; c2_i134 = c2_i134 + 1) {
      c2_t_A[c2_i134] = c2_s_A[c2_i134];
    }

    for (c2_i135 = 0; c2_i135 < 9; c2_i135 = c2_i135 + 1) {
      c2_t_B[c2_i135] = c2_s_B[c2_i135];
    }

    for (c2_i136 = 0; c2_i136 < 9; c2_i136 = c2_i136 + 1) {
      c2_u_A[c2_i136] = c2_t_A[c2_i136];
    }

    for (c2_i137 = 0; c2_i137 < 9; c2_i137 = c2_i137 + 1) {
      c2_u_B[c2_i137] = c2_t_B[c2_i137];
    }

    for (c2_i138 = 0; c2_i138 < 3; c2_i138 = c2_i138 + 1) {
      for (c2_i139 = 0; c2_i139 < 3; c2_i139 = c2_i139 + 1) {
        c2_x_y[c2_i138 + 3 * c2_i139] = 0.0;
        for (c2_i140 = 0; c2_i140 < 3; c2_i140 = c2_i140 + 1) {
          c2_x_y[c2_i138 + 3 * c2_i139] = c2_x_y[c2_i138 + 3 * c2_i139] +
            c2_u_A[c2_i138 + 3 * c2_i140] * c2_u_B[c2_i140 + 3 * c2_i139];
        }
      }
    }

    for (c2_i141 = 0; c2_i141 < 6; c2_i141 = c2_i141 + 1) {
      c2_p_a[c2_i141] = c2_G[c2_i141];
    }

    for (c2_i142 = 0; c2_i142 < 4; c2_i142 = c2_i142 + 1) {
      c2_p_b[c2_i142] = c2_Q[c2_i142];
    }

    for (c2_i143 = 0; c2_i143 < 6; c2_i143 = c2_i143 + 1) {
      c2_v_A[c2_i143] = c2_p_a[c2_i143];
    }

    for (c2_i144 = 0; c2_i144 < 4; c2_i144 = c2_i144 + 1) {
      c2_v_B[c2_i144] = c2_p_b[c2_i144];
    }

    for (c2_i145 = 0; c2_i145 < 6; c2_i145 = c2_i145 + 1) {
      c2_w_A[c2_i145] = c2_v_A[c2_i145];
    }

    for (c2_i146 = 0; c2_i146 < 4; c2_i146 = c2_i146 + 1) {
      c2_w_B[c2_i146] = c2_v_B[c2_i146];
    }

    for (c2_i147 = 0; c2_i147 < 6; c2_i147 = c2_i147 + 1) {
      c2_x_A[c2_i147] = c2_w_A[c2_i147];
    }

    for (c2_i148 = 0; c2_i148 < 4; c2_i148 = c2_i148 + 1) {
      c2_x_B[c2_i148] = c2_w_B[c2_i148];
    }

    for (c2_i149 = 0; c2_i149 < 3; c2_i149 = c2_i149 + 1) {
      for (c2_i150 = 0; c2_i150 < 2; c2_i150 = c2_i150 + 1) {
        c2_q_a[c2_i149 + 3 * c2_i150] = 0.0;
        for (c2_i151 = 0; c2_i151 < 2; c2_i151 = c2_i151 + 1) {
          c2_q_a[c2_i149 + 3 * c2_i150] = c2_q_a[c2_i149 + 3 * c2_i150] +
            c2_x_A[c2_i149 + 3 * c2_i151] * c2_x_B[c2_i151 + 2 * c2_i150];
        }
      }
    }

    for (c2_i152 = 0; c2_i152 < 3; c2_i152 = c2_i152 + 1) {
      for (c2_i153 = 0; c2_i153 < 2; c2_i153 = c2_i153 + 1) {
        c2_q_b[c2_i153 + 2 * c2_i152] = c2_G[c2_i152 + 3 * c2_i153];
      }
    }

    for (c2_i154 = 0; c2_i154 < 6; c2_i154 = c2_i154 + 1) {
      c2_y_A[c2_i154] = c2_q_a[c2_i154];
    }

    for (c2_i155 = 0; c2_i155 < 6; c2_i155 = c2_i155 + 1) {
      c2_y_B[c2_i155] = c2_q_b[c2_i155];
    }

    for (c2_i156 = 0; c2_i156 < 6; c2_i156 = c2_i156 + 1) {
      c2_ab_A[c2_i156] = c2_y_A[c2_i156];
    }

    for (c2_i157 = 0; c2_i157 < 6; c2_i157 = c2_i157 + 1) {
      c2_ab_B[c2_i157] = c2_y_B[c2_i157];
    }

    for (c2_i158 = 0; c2_i158 < 6; c2_i158 = c2_i158 + 1) {
      c2_bb_A[c2_i158] = c2_ab_A[c2_i158];
    }

    for (c2_i159 = 0; c2_i159 < 6; c2_i159 = c2_i159 + 1) {
      c2_bb_B[c2_i159] = c2_ab_B[c2_i159];
    }

    for (c2_i160 = 0; c2_i160 < 3; c2_i160 = c2_i160 + 1) {
      for (c2_i161 = 0; c2_i161 < 3; c2_i161 = c2_i161 + 1) {
        c2_y_y[c2_i160 + 3 * c2_i161] = 0.0;
        for (c2_i162 = 0; c2_i162 < 2; c2_i162 = c2_i162 + 1) {
          c2_y_y[c2_i160 + 3 * c2_i161] = c2_y_y[c2_i160 + 3 * c2_i161] +
            c2_bb_A[c2_i160 + 3 * c2_i162] * c2_bb_B[c2_i162 + 2 * c2_i161];
        }
      }
    }

    for (c2_i163 = 0; c2_i163 < 9; c2_i163 = c2_i163 + 1) {
      c2_r_a[c2_i163] = c2_Phi[c2_i163];
    }

    for (c2_i164 = 0; c2_i164 < 9; c2_i164 = c2_i164 + 1) {
      c2_r_b[c2_i164] = c2_Pk[c2_i164];
    }

    for (c2_i165 = 0; c2_i165 < 9; c2_i165 = c2_i165 + 1) {
      c2_cb_A[c2_i165] = c2_r_a[c2_i165];
    }

    for (c2_i166 = 0; c2_i166 < 9; c2_i166 = c2_i166 + 1) {
      c2_cb_B[c2_i166] = c2_r_b[c2_i166];
    }

    for (c2_i167 = 0; c2_i167 < 9; c2_i167 = c2_i167 + 1) {
      c2_db_A[c2_i167] = c2_cb_A[c2_i167];
    }

    for (c2_i168 = 0; c2_i168 < 9; c2_i168 = c2_i168 + 1) {
      c2_db_B[c2_i168] = c2_cb_B[c2_i168];
    }

    for (c2_i169 = 0; c2_i169 < 9; c2_i169 = c2_i169 + 1) {
      c2_eb_A[c2_i169] = c2_db_A[c2_i169];
    }

    for (c2_i170 = 0; c2_i170 < 9; c2_i170 = c2_i170 + 1) {
      c2_eb_B[c2_i170] = c2_db_B[c2_i170];
    }

    for (c2_i171 = 0; c2_i171 < 3; c2_i171 = c2_i171 + 1) {
      for (c2_i172 = 0; c2_i172 < 3; c2_i172 = c2_i172 + 1) {
        c2_s_a[c2_i171 + 3 * c2_i172] = 0.0;
        for (c2_i173 = 0; c2_i173 < 3; c2_i173 = c2_i173 + 1) {
          c2_s_a[c2_i171 + 3 * c2_i172] = c2_s_a[c2_i171 + 3 * c2_i172] +
            c2_eb_A[c2_i171 + 3 * c2_i173] * c2_eb_B[c2_i173 + 3 * c2_i172];
        }
      }
    }

    for (c2_i174 = 0; c2_i174 < 3; c2_i174 = c2_i174 + 1) {
      for (c2_i175 = 0; c2_i175 < 3; c2_i175 = c2_i175 + 1) {
        c2_s_b[c2_i175 + 3 * c2_i174] = c2_Phi[c2_i174 + 3 * c2_i175];
      }
    }

    for (c2_i176 = 0; c2_i176 < 9; c2_i176 = c2_i176 + 1) {
      c2_fb_A[c2_i176] = c2_s_a[c2_i176];
    }

    for (c2_i177 = 0; c2_i177 < 9; c2_i177 = c2_i177 + 1) {
      c2_fb_B[c2_i177] = c2_s_b[c2_i177];
    }

    for (c2_i178 = 0; c2_i178 < 9; c2_i178 = c2_i178 + 1) {
      c2_gb_A[c2_i178] = c2_fb_A[c2_i178];
    }

    for (c2_i179 = 0; c2_i179 < 9; c2_i179 = c2_i179 + 1) {
      c2_gb_B[c2_i179] = c2_fb_B[c2_i179];
    }

    for (c2_i180 = 0; c2_i180 < 9; c2_i180 = c2_i180 + 1) {
      c2_hb_A[c2_i180] = c2_gb_A[c2_i180];
    }

    for (c2_i181 = 0; c2_i181 < 9; c2_i181 = c2_i181 + 1) {
      c2_hb_B[c2_i181] = c2_gb_B[c2_i181];
    }

    for (c2_i182 = 0; c2_i182 < 3; c2_i182 = c2_i182 + 1) {
      for (c2_i183 = 0; c2_i183 < 3; c2_i183 = c2_i183 + 1) {
        c2_ab_y[c2_i182 + 3 * c2_i183] = 0.0;
        for (c2_i184 = 0; c2_i184 < 3; c2_i184 = c2_i184 + 1) {
          c2_ab_y[c2_i182 + 3 * c2_i183] = c2_ab_y[c2_i182 + 3 * c2_i183] +
            c2_hb_A[c2_i182 + 3 * c2_i184] * c2_hb_B[c2_i184 + 3 * c2_i183];
        }
      }
    }

    for (c2_i185 = 0; c2_i185 < 9; c2_i185 = c2_i185 + 1) {
      c2_Pkplus1[c2_i185] = (c2_ab_y[c2_i185] + c2_y_y[c2_i185]) -
        c2_x_y[c2_i185];
    }
  }

  _SFD_EML_CALL(0,-11);
  sf_debug_symbol_scope_pop();
  for (c2_i186 = 0; c2_i186 < 3; c2_i186 = c2_i186 + 1) {
    (*c2_b_xkplus1)[c2_i186] = c2_xkplus1[c2_i186];
  }

  for (c2_i187 = 0; c2_i187 < 9; c2_i187 = c2_i187 + 1) {
    (*c2_b_Pkplus1)[c2_i187] = c2_Pkplus1[c2_i187];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
}

static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
  c2_chartNumber)
{
}

static real_T c2_norm(real_T c2_x)
{
  real_T c2_b_x;
  real_T c2_c_x;
  real_T c2_b_y;
  c2_b_x = c2_x;
  c2_c_x = c2_b_x;
  c2_b_y = muDoubleScalarAbs(c2_c_x);
  return c2_b_y;
}

static real_T c2_abs(real_T c2_x)
{
  real_T c2_b_x;
  real_T c2_b_y;
  c2_b_x = c2_x;
  c2_b_y = muDoubleScalarAbs(c2_b_x);
  return c2_b_y;
}

static real_T c2_b_norm(real_T c2_x[9])
{
  int32_T c2_i188;
  real_T c2_b_x[9];
  real_T c2_s[3];
  for (c2_i188 = 0; c2_i188 < 9; c2_i188 = c2_i188 + 1) {
    c2_b_x[c2_i188] = c2_x[c2_i188];
  }

  c2_svd(c2_b_x, c2_s);
  return c2_s[0];
}

static void c2_svd(real_T c2_A[9], real_T c2_Uout[3])
{
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_s[3];
  real_T c2_e[3];
  real_T c2_work[3];
  int32_T c2_q;
  int32_T c2_b_q;
  int32_T c2_a;
  int32_T c2_qp1;
  int32_T c2_b_a;
  int32_T c2_qm1;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_qq;
  int32_T c2_c_b;
  int32_T c2_nmq;
  int32_T c2_d_a;
  int32_T c2_nmqp1;
  int32_T c2_i189;
  real_T c2_b_A[9];
  real_T c2_nrm;
  real_T c2_absx;
  real_T c2_d;
  real_T c2_y;
  real_T c2_b_y;
  real_T c2_c_y;
  real_T c2_z;
  int32_T c2_i190;
  real_T c2_c_A[9];
  int32_T c2_b_qp1;
  int32_T c2_jj;
  int32_T c2_b_jj;
  int32_T c2_e_a;
  int32_T c2_f_a;
  int32_T c2_d_b;
  int32_T c2_e_b;
  int32_T c2_qjj;
  int32_T c2_i191;
  real_T c2_d_A[9];
  int32_T c2_i192;
  real_T c2_e_A[9];
  real_T c2_t;
  real_T c2_x;
  real_T c2_d_y;
  real_T c2_b_x;
  real_T c2_e_y;
  real_T c2_b_z;
  int32_T c2_i193;
  real_T c2_f_A[9];
  int32_T c2_f_b;
  int32_T c2_pmq;
  int32_T c2_i194;
  real_T c2_b_e[3];
  real_T c2_b_absx;
  real_T c2_b_d;
  real_T c2_f_y;
  real_T c2_g_y;
  real_T c2_h_y;
  real_T c2_c_z;
  int32_T c2_i195;
  real_T c2_c_e[3];
  int32_T c2_c_qp1;
  int32_T c2_ii;
  int32_T c2_b_ii;
  int32_T c2_d_qp1;
  int32_T c2_c_jj;
  int32_T c2_g_a;
  int32_T c2_h_a;
  int32_T c2_g_b;
  int32_T c2_h_b;
  int32_T c2_qp1jj;
  int32_T c2_i196;
  real_T c2_g_A[9];
  int32_T c2_i197;
  real_T c2_b_work[3];
  int32_T c2_e_qp1;
  int32_T c2_d_jj;
  real_T c2_c_x;
  real_T c2_i_y;
  real_T c2_d_x;
  real_T c2_j_y;
  int32_T c2_i_a;
  int32_T c2_j_a;
  int32_T c2_i_b;
  int32_T c2_j_b;
  int32_T c2_i198;
  real_T c2_c_work[3];
  int32_T c2_i199;
  real_T c2_h_A[9];
  int32_T c2_m;
  int32_T c2_c_q;
  real_T c2_rt;
  real_T c2_e_x;
  real_T c2_k_y;
  real_T c2_f_x;
  real_T c2_l_y;
  real_T c2_r;
  real_T c2_g_x;
  real_T c2_m_y;
  real_T c2_h_x;
  real_T c2_n_y;
  real_T c2_d_z;
  real_T c2_i_x;
  real_T c2_o_y;
  real_T c2_j_x;
  real_T c2_p_y;
  int32_T c2_k_a;
  int32_T c2_c;
  int32_T c2_l_a;
  int32_T c2_b_c;
  real_T c2_m_a;
  real_T c2_k_b;
  real_T c2_q_y;
  real_T c2_iter;
  real_T c2_snorm;
  int32_T c2_c_ii;
  int32_T c2_n_a;
  int32_T c2_o_a;
  int32_T c2_i200;
  int32_T c2_d_ii;
  int32_T c2_p_a;
  int32_T c2_c_c;
  real_T c2_test0;
  real_T c2_ztest0;
  real_T c2_l_b;
  real_T c2_r_y;
  real_T c2_m_b;
  real_T c2_s_y;
  int32_T c2_q_a;
  int32_T c2_d_c;
  real_T c2_kase;
  int32_T c2_qs;
  int32_T c2_b_m;
  int32_T c2_e_ii;
  real_T c2_test;
  int32_T c2_r_a;
  int32_T c2_e_c;
  int32_T c2_s_a;
  int32_T c2_f_c;
  real_T c2_ztest;
  real_T c2_n_b;
  real_T c2_t_y;
  int32_T c2_t_a;
  int32_T c2_u_a;
  int32_T c2_g_c;
  real_T c2_f;
  int32_T c2_v_a;
  int32_T c2_h_c;
  int32_T c2_w_a;
  int32_T c2_i201;
  int32_T c2_c_k;
  real_T c2_t1;
  real_T c2_b_t1;
  real_T c2_b_f;
  real_T c2_sn;
  real_T c2_cs;
  int32_T c2_x_a;
  int32_T c2_km1;
  real_T c2_y_a;
  real_T c2_o_b;
  real_T c2_ab_a;
  real_T c2_p_b;
  real_T c2_u_y;
  int32_T c2_bb_a;
  int32_T c2_d_q;
  int32_T c2_d_k;
  real_T c2_c_t1;
  real_T c2_c_f;
  real_T c2_cb_a;
  real_T c2_q_b;
  real_T c2_db_a;
  real_T c2_r_b;
  real_T c2_v_y;
  int32_T c2_eb_a;
  int32_T c2_mm1;
  real_T c2_d0;
  real_T c2_d1;
  real_T c2_d2;
  real_T c2_d3;
  real_T c2_d4;
  real_T c2_dv0[5];
  real_T c2_scale;
  real_T c2_k_x;
  real_T c2_w_y;
  real_T c2_l_x;
  real_T c2_x_y;
  real_T c2_sm;
  real_T c2_m_x;
  real_T c2_y_y;
  real_T c2_n_x;
  real_T c2_ab_y;
  real_T c2_smm1;
  real_T c2_o_x;
  real_T c2_bb_y;
  real_T c2_p_x;
  real_T c2_cb_y;
  real_T c2_emm1;
  real_T c2_q_x;
  real_T c2_db_y;
  real_T c2_r_x;
  real_T c2_eb_y;
  real_T c2_sqds;
  real_T c2_s_x;
  real_T c2_fb_y;
  real_T c2_t_x;
  real_T c2_gb_y;
  real_T c2_eqds;
  real_T c2_fb_a;
  real_T c2_s_b;
  real_T c2_hb_y;
  real_T c2_gb_a;
  real_T c2_t_b;
  real_T c2_ib_y;
  real_T c2_u_x;
  real_T c2_v_x;
  real_T c2_u_b;
  real_T c2_hb_a;
  real_T c2_v_b;
  real_T c2_i_c;
  real_T c2_ib_a;
  real_T c2_w_b;
  real_T c2_shift;
  real_T c2_jb_a;
  real_T c2_x_b;
  real_T c2_jb_y;
  real_T c2_w_x;
  real_T c2_kb_y;
  real_T c2_x_x;
  real_T c2_lb_y;
  real_T c2_kb_a;
  real_T c2_y_b;
  real_T c2_mb_y;
  real_T c2_lb_a;
  real_T c2_ab_b;
  real_T c2_g;
  int32_T c2_e_q;
  int32_T c2_e_k;
  int32_T c2_mb_a;
  int32_T c2_nb_a;
  int32_T c2_kp1;
  real_T c2_d_f;
  real_T c2_b_g;
  real_T c2_ob_a;
  real_T c2_bb_b;
  real_T c2_nb_y;
  real_T c2_pb_a;
  real_T c2_cb_b;
  real_T c2_ob_y;
  real_T c2_qb_a;
  real_T c2_db_b;
  real_T c2_pb_y;
  real_T c2_rb_a;
  real_T c2_eb_b;
  real_T c2_qb_y;
  real_T c2_sb_a;
  real_T c2_fb_b;
  real_T c2_tb_a;
  real_T c2_gb_b;
  real_T c2_rb_y;
  real_T c2_e_f;
  real_T c2_c_g;
  real_T c2_ub_a;
  real_T c2_hb_b;
  real_T c2_sb_y;
  real_T c2_vb_a;
  real_T c2_ib_b;
  real_T c2_tb_y;
  real_T c2_wb_a;
  real_T c2_jb_b;
  real_T c2_ub_y;
  real_T c2_xb_a;
  real_T c2_kb_b;
  real_T c2_vb_y;
  real_T c2_yb_a;
  real_T c2_lb_b;
  real_T c2_ac_a;
  real_T c2_mb_b;
  real_T c2_wb_y;
  int32_T c2_bc_a;
  int32_T c2_j_c;
  int32_T c2_cc_a;
  int32_T c2_dc_a;
  int32_T c2_ec_a;
  int32_T c2_i202;
  for (c2_k = 1; c2_k < 10; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    if (!c2_isfinite(c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK(
           "k", (real_T)c2_b_k), 1, 9, 1, 0) - 1])) {
      c2_eml_error();
    }
  }

  c2_eml_zeros(c2_s);
  c2_b_eml_zeros(c2_e);
  c2_b_eml_zeros(c2_work);
  for (c2_q = 1; c2_q < 3; c2_q = c2_q + 1) {
    c2_b_q = c2_q;
    c2_a = c2_b_q;
    c2_qp1 = c2_a + 1;
    c2_b_a = c2_b_q;
    c2_qm1 = c2_b_a - 1;
    c2_c_a = c2_b_q;
    c2_b = c2_qm1;
    c2_b_b = 3 * c2_b;
    c2_qq = c2_c_a + c2_b_b;
    c2_c_b = c2_b_q;
    c2_nmq = 3 - c2_c_b;
    c2_d_a = c2_nmq;
    c2_nmqp1 = c2_d_a + 1;
    if (c2_b_q <= 2) {
      for (c2_i189 = 0; c2_i189 < 9; c2_i189 = c2_i189 + 1) {
        c2_b_A[c2_i189] = c2_A[c2_i189];
      }

      c2_nrm = c2_eml_xnrm2(c2_nmqp1, c2_b_A, c2_qq);
      if (c2_nrm == 0.0) {
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = 0.0;
      } else {
        c2_absx = c2_nrm;
        c2_d = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("qq",
          (real_T)c2_qq), 1, 9, 1, 0) - 1];
        if (c2_d < 0.0) {
          c2_y = -c2_absx;
        } else {
          c2_y = c2_absx;
        }

        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = c2_y;
        c2_b_y = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_c_y = c2_b_y;
        c2_z = 1.0 / c2_c_y;
        for (c2_i190 = 0; c2_i190 < 9; c2_i190 = c2_i190 + 1) {
          c2_c_A[c2_i190] = c2_A[c2_i190];
        }

        c2_eml_xscal(c2_nmqp1, c2_z, c2_c_A, c2_qq, c2_A);
        c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("qq", (real_T)
          c2_qq), 1, 9, 1, 0) - 1] = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK(
          "A", _SFD_INTEGER_CHECK("qq", (real_T)c2_qq), 1, 9, 1, 0) - 1] + 1.0;
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = -c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
          "s", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1];
      }
    }

    c2_b_qp1 = c2_qp1;
    for (c2_jj = c2_b_qp1; c2_jj < 4; c2_jj = c2_jj + 1) {
      c2_b_jj = c2_jj;
      c2_e_a = c2_b_q;
      c2_f_a = c2_b_jj;
      c2_d_b = c2_f_a - 1;
      c2_e_b = 3 * c2_d_b;
      c2_qjj = c2_e_a + c2_e_b;
      if (c2_b_q <= 2) {
        if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
          for (c2_i191 = 0; c2_i191 < 9; c2_i191 = c2_i191 + 1) {
            c2_d_A[c2_i191] = c2_A[c2_i191];
          }

          for (c2_i192 = 0; c2_i192 < 9; c2_i192 = c2_i192 + 1) {
            c2_e_A[c2_i192] = c2_A[c2_i192];
          }

          c2_t = c2_eml_xdotc(c2_nmqp1, c2_d_A, c2_qq, c2_e_A, c2_qjj);
          c2_x = c2_t;
          c2_d_y = c2_A[(_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("q",
                           (real_T)c2_b_q), 1, 3, 1, 0) - 1) + 3 * (
            _SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 3, 2, 0) - 1)];
          c2_b_x = c2_x;
          c2_e_y = c2_d_y;
          c2_b_z = c2_b_x / c2_e_y;
          c2_t = -c2_b_z;
          for (c2_i193 = 0; c2_i193 < 9; c2_i193 = c2_i193 + 1) {
            c2_f_A[c2_i193] = c2_A[c2_i193];
          }

          c2_eml_xaxpy(c2_nmqp1, c2_t, c2_qq, c2_f_A, c2_qjj, c2_A);
          goto label_1;
        }
      }

     label_1:
      ;
      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("jj", (real_T)
        c2_b_jj), 1, 3, 1, 0) - 1] = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK
        ("A", _SFD_INTEGER_CHECK("qjj", (real_T)c2_qjj), 1, 9, 1, 0) - 1];
    }

    if (c2_b_q <= 1) {
      c2_f_b = c2_b_q;
      c2_pmq = 3 - c2_f_b;
      for (c2_i194 = 0; c2_i194 < 3; c2_i194 = c2_i194 + 1) {
        c2_b_e[c2_i194] = c2_e[c2_i194];
      }

      c2_nrm = c2_b_eml_xnrm2(c2_pmq, c2_b_e, c2_qp1);
      if (c2_nrm == 0.0) {
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = 0.0;
      } else {
        c2_b_absx = c2_nrm;
        c2_b_d = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qp1",
          (real_T)c2_qp1), 1, 3, 1, 0) - 1];
        if (c2_b_d < 0.0) {
          c2_f_y = -c2_b_absx;
        } else {
          c2_f_y = c2_b_absx;
        }

        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = c2_f_y;
        c2_g_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_h_y = c2_g_y;
        c2_c_z = 1.0 / c2_h_y;
        for (c2_i195 = 0; c2_i195 < 3; c2_i195 = c2_i195 + 1) {
          c2_c_e[c2_i195] = c2_e[c2_i195];
        }

        c2_b_eml_xscal(c2_pmq, c2_c_z, c2_c_e, c2_qp1, c2_e);
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qp1", (real_T)
          c2_qp1), 1, 3, 1, 0) - 1] = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK
          ("e", _SFD_INTEGER_CHECK("qp1", (real_T)c2_qp1), 1, 3, 1, 0) - 1] +
          1.0;
      }

      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
        c2_b_q), 1, 3, 1, 0) - 1] = -c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK(
        "e", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1];
      if (c2_qp1 <= 3) {
        if (c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
          c2_c_qp1 = c2_qp1;
          for (c2_ii = c2_c_qp1; c2_ii < 4; c2_ii = c2_ii + 1) {
            c2_b_ii = c2_ii;
            c2_work[_SFD_EML_ARRAY_BOUNDS_CHECK("work", _SFD_INTEGER_CHECK("ii",
              (real_T)c2_b_ii), 1, 3, 1, 0) - 1] = 0.0;
          }

          c2_d_qp1 = c2_qp1;
          for (c2_c_jj = c2_d_qp1; c2_c_jj < 4; c2_c_jj = c2_c_jj + 1) {
            c2_b_jj = c2_c_jj;
            c2_g_a = c2_qp1;
            c2_h_a = c2_b_jj;
            c2_g_b = c2_h_a - 1;
            c2_h_b = 3 * c2_g_b;
            c2_qp1jj = c2_g_a + c2_h_b;
            for (c2_i196 = 0; c2_i196 < 9; c2_i196 = c2_i196 + 1) {
              c2_g_A[c2_i196] = c2_A[c2_i196];
            }

            for (c2_i197 = 0; c2_i197 < 3; c2_i197 = c2_i197 + 1) {
              c2_b_work[c2_i197] = c2_work[c2_i197];
            }

            c2_b_eml_xaxpy(c2_nmq, c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
              _SFD_INTEGER_CHECK("jj", (real_T)c2_b_jj), 1, 3, 1, 0) - 1],
                           c2_g_A,
                           c2_qp1jj, c2_b_work, c2_qp1, c2_work);
          }

          c2_e_qp1 = c2_qp1;
          for (c2_d_jj = c2_e_qp1; c2_d_jj < 4; c2_d_jj = c2_d_jj + 1) {
            c2_b_jj = c2_d_jj;
            c2_c_x = -c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "jj", (real_T)c2_b_jj), 1, 3, 1, 0) - 1];
            c2_i_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "qp1", (real_T)c2_qp1), 1, 3, 1, 0) - 1];
            c2_d_x = c2_c_x;
            c2_j_y = c2_i_y;
            c2_t = c2_d_x / c2_j_y;
            c2_i_a = c2_qp1;
            c2_j_a = c2_b_jj;
            c2_i_b = c2_j_a - 1;
            c2_j_b = 3 * c2_i_b;
            c2_qp1jj = c2_i_a + c2_j_b;
            for (c2_i198 = 0; c2_i198 < 3; c2_i198 = c2_i198 + 1) {
              c2_c_work[c2_i198] = c2_work[c2_i198];
            }

            for (c2_i199 = 0; c2_i199 < 9; c2_i199 = c2_i199 + 1) {
              c2_h_A[c2_i199] = c2_A[c2_i199];
            }

            c2_c_eml_xaxpy(c2_nmq, c2_t, c2_c_work, c2_qp1, c2_h_A, c2_qp1jj,
                           c2_A);
          }

          goto label_2;
        }
      }

     label_2:
      ;
    }
  }

  c2_m = 3;
  c2_s[2] = c2_A[8];
  c2_e[1] = c2_A[7];
  c2_e[2] = 0.0;
  for (c2_c_q = 1; c2_c_q < 4; c2_c_q = c2_c_q + 1) {
    c2_b_q = c2_c_q;
    if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
      c2_rt = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
        "q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
      c2_e_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
        (real_T)c2_b_q), 1, 3, 1, 0) - 1];
      c2_k_y = c2_rt;
      c2_f_x = c2_e_x;
      c2_l_y = c2_k_y;
      c2_r = c2_f_x / c2_l_y;
      c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
        c2_b_q), 1, 3, 1, 0) - 1] = c2_rt;
      if (c2_b_q < 3) {
        c2_g_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_m_y = c2_r;
        c2_h_x = c2_g_x;
        c2_n_y = c2_m_y;
        c2_d_z = c2_h_x / c2_n_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = c2_d_z;
      }
    }

    if (c2_b_q < 3) {
      if (c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
        c2_rt = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
        c2_i_x = c2_rt;
        c2_o_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_j_x = c2_i_x;
        c2_p_y = c2_o_y;
        c2_r = c2_j_x / c2_p_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = c2_rt;
        c2_k_a = c2_b_q;
        c2_c = c2_k_a + 1;
        c2_l_a = c2_b_q;
        c2_b_c = c2_l_a + 1;
        c2_m_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
          (real_T)c2_b_c), 1, 3, 1, 0) - 1];
        c2_k_b = c2_r;
        c2_q_y = c2_m_a * c2_k_b;
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("", (real_T)
          c2_c), 1, 3, 1, 0) - 1] = c2_q_y;
      }
    }
  }

  c2_iter = 0.0;
  c2_snorm = 0.0;
  for (c2_c_ii = 1; c2_c_ii < 4; c2_c_ii = c2_c_ii + 1) {
    c2_b_ii = c2_c_ii;
    c2_snorm = c2_max(c2_snorm, c2_max(c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
      "s", _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1,
      0) - 1]), c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
      "ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1])));
  }

 label_11:
  ;
  if ((real_T)c2_m > 0.0) {
    if (c2_iter >= 75.0) {
      c2_c_eml_error();
    } else {
      c2_n_a = c2_m;
      c2_b_q = c2_n_a - 1;
      c2_o_a = c2_m;
      c2_i200 = c2_o_a - 1;
      c2_d_ii = c2_i200;
     label_6:
      ;
      if (c2_d_ii >= 0) {
        c2_b_ii = c2_d_ii;
        c2_b_q = c2_b_ii;
        if ((real_T)c2_b_ii == 0.0) {
          goto label_3;
        } else {
          c2_p_a = c2_b_ii;
          c2_c_c = c2_p_a + 1;
          c2_test0 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]) +
            c2_abs(c2_s[
                   _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
                     (real_T)c2_c_c), 1, 3, 1, 0) - 1]);
          c2_ztest0 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]);
          c2_l_b = c2_test0;
          c2_r_y = 2.2204460492503131E-016 * c2_l_b;
          if (c2_ztest0 <= c2_r_y) {
            goto label_4;
          } else if (c2_ztest0 <= 1.0020841800044864E-292) {
            goto label_4;
          } else {
            if (c2_iter > 20.0) {
              c2_m_b = c2_snorm;
              c2_s_y = 2.2204460492503131E-016 * c2_m_b;
              if (c2_ztest0 <= c2_s_y) {
                goto label_5;
              }
            }
          }
        }
      } else {
        goto label_3;
      }

      c2_d_ii = c2_d_ii + -1;
      goto label_6;
     label_4:
      ;
     label_5:
      ;
      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("ii", (real_T)
        c2_b_ii), 1, 3, 1, 0) - 1] = 0.0;
     label_3:
      ;
      c2_q_a = c2_m;
      c2_d_c = c2_q_a - 1;
      if (c2_b_q == c2_d_c) {
        c2_kase = 4.0;
      } else {
        c2_qs = c2_m;
        c2_b_m = c2_m;
        c2_e_ii = c2_b_m;
       label_8:
        ;
        if (c2_e_ii >= c2_b_q) {
          c2_b_ii = c2_e_ii;
          c2_qs = c2_b_ii;
          if (c2_b_ii == c2_b_q) {
            goto label_7;
          } else {
            c2_test = 0.0;
            if (c2_b_ii < c2_m) {
              c2_test = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]);
            }

            c2_r_a = c2_b_q;
            c2_e_c = c2_r_a + 1;
            if (c2_b_ii > c2_e_c) {
              c2_s_a = c2_b_ii;
              c2_f_c = c2_s_a - 1;
              c2_test = c2_test + c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("", (real_T)c2_f_c), 1, 3, 1, 0) - 1]);
            }

            c2_ztest = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
              _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]);
            c2_n_b = c2_test;
            c2_t_y = 2.2204460492503131E-016 * c2_n_b;
            if (c2_ztest <= c2_t_y) {
            } else if (c2_ztest <= 1.0020841800044864E-292) {
            } else {
              c2_e_ii = c2_e_ii + -1;
              goto label_8;
            }
          }
        } else {
          goto label_7;
        }

        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("ii", (real_T)
          c2_b_ii), 1, 3, 1, 0) - 1] = 0.0;
       label_7:
        ;
        if (c2_qs == c2_b_q) {
          c2_kase = 3.0;
        } else if (c2_qs == c2_m) {
          c2_kase = 1.0;
        } else {
          c2_kase = 2.0;
          c2_b_q = c2_qs;
        }
      }

      c2_t_a = c2_b_q;
      c2_b_q = c2_t_a + 1;
      switch ((int32_T)_SFD_INTEGER_CHECK("kase", c2_kase)) {
       case 1:
        c2_u_a = c2_m;
        c2_g_c = c2_u_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("",
          (real_T)c2_g_c), 1, 3, 1, 0) - 1];
        c2_v_a = c2_m;
        c2_h_c = c2_v_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_h_c), 1, 3, 1, 0) - 1] = 0.0;
        c2_w_a = c2_m;
        c2_i201 = c2_w_a - 1;
        for (c2_c_k = c2_i201; c2_c_k >= c2_b_q; c2_c_k = c2_c_k + -1) {
          c2_b_k = c2_c_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_b_t1 = c2_t1;
          c2_b_f = c2_f;
          c2_eml_xrotg(c2_b_t1, c2_b_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_t1;
          if (c2_b_k > c2_b_q) {
            c2_x_a = c2_b_k;
            c2_km1 = c2_x_a - 1;
            c2_y_a = -c2_sn;
            c2_o_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 3, 1, 0) - 1];
            c2_f = c2_y_a * c2_o_b;
            c2_ab_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 3, 1, 0) - 1];
            c2_p_b = c2_cs;
            c2_u_y = c2_ab_a * c2_p_b;
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 3, 1, 0) - 1] = c2_u_y;
          }
        }
        break;

       case 2:
        c2_bb_a = c2_b_q;
        c2_qm1 = c2_bb_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1",
          (real_T)c2_qm1), 1, 3, 1, 0) - 1];
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1", (real_T)
          c2_qm1), 1, 3, 1, 0) - 1] = 0.0;
        c2_d_q = c2_b_q;
        for (c2_d_k = c2_d_q; c2_d_k <= c2_m; c2_d_k = c2_d_k + 1) {
          c2_b_k = c2_d_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_c_t1 = c2_t1;
          c2_c_f = c2_f;
          c2_eml_xrotg(c2_c_t1, c2_c_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_t1;
          c2_cb_a = -c2_sn;
          c2_q_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_f = c2_cb_a * c2_q_b;
          c2_db_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_r_b = c2_cs;
          c2_v_y = c2_db_a * c2_r_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_v_y;
        }
        break;

       case 3:
        c2_eb_a = c2_m;
        c2_mm1 = c2_eb_a - 1;
        c2_d0 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
          "m", (real_T)c2_m), 1, 3, 1, 0) - 1]);
        c2_d1 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
          "mm1", (real_T)c2_mm1), 1, 3, 1, 0) - 1]);
        c2_d2 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "mm1", (real_T)c2_mm1), 1, 3, 1, 0) - 1]);
        c2_d3 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
          "q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
        c2_d4 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
        c2_dv0[0] = c2_d0;
        c2_dv0[1] = c2_d1;
        c2_dv0[2] = c2_d2;
        c2_dv0[3] = c2_d3;
        c2_dv0[4] = c2_d4;
        c2_scale = c2_b_max(c2_dv0);
        c2_k_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("m",
          (real_T)c2_m), 1, 3, 1, 0) - 1];
        c2_w_y = c2_scale;
        c2_l_x = c2_k_x;
        c2_x_y = c2_w_y;
        c2_sm = c2_l_x / c2_x_y;
        c2_m_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 3, 1, 0) - 1];
        c2_y_y = c2_scale;
        c2_n_x = c2_m_x;
        c2_ab_y = c2_y_y;
        c2_smm1 = c2_n_x / c2_ab_y;
        c2_o_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 3, 1, 0) - 1];
        c2_bb_y = c2_scale;
        c2_p_x = c2_o_x;
        c2_cb_y = c2_bb_y;
        c2_emm1 = c2_p_x / c2_cb_y;
        c2_q_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_db_y = c2_scale;
        c2_r_x = c2_q_x;
        c2_eb_y = c2_db_y;
        c2_sqds = c2_r_x / c2_eb_y;
        c2_s_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_fb_y = c2_scale;
        c2_t_x = c2_s_x;
        c2_gb_y = c2_fb_y;
        c2_eqds = c2_t_x / c2_gb_y;
        c2_fb_a = c2_emm1;
        c2_s_b = c2_emm1;
        c2_hb_y = c2_fb_a * c2_s_b;
        c2_gb_a = c2_smm1 + c2_sm;
        c2_t_b = c2_smm1 - c2_sm;
        c2_ib_y = c2_gb_a * c2_t_b;
        c2_u_x = c2_ib_y + c2_hb_y;
        c2_v_x = c2_u_x;
        c2_u_b = c2_v_x / 2.0;
        c2_hb_a = c2_sm;
        c2_v_b = c2_emm1;
        c2_i_c = c2_hb_a * c2_v_b;
        c2_ib_a = c2_i_c;
        c2_w_b = c2_i_c;
        c2_i_c = c2_ib_a * c2_w_b;
        c2_shift = 0.0;
        if (c2_u_b != 0.0) {
        } else if (c2_i_c != 0.0) {
        } else {
          goto label_9;
        }

        c2_jb_a = c2_u_b;
        c2_x_b = c2_u_b;
        c2_jb_y = c2_jb_a * c2_x_b;
        c2_shift = c2_sqrt(c2_jb_y + c2_i_c);
        if (c2_u_b < 0.0) {
          c2_shift = -c2_shift;
        }

        c2_w_x = c2_i_c;
        c2_kb_y = c2_u_b + c2_shift;
        c2_x_x = c2_w_x;
        c2_lb_y = c2_kb_y;
        c2_shift = c2_x_x / c2_lb_y;
       label_9:
        ;
        c2_kb_a = c2_sqds + c2_sm;
        c2_y_b = c2_sqds - c2_sm;
        c2_mb_y = c2_kb_a * c2_y_b;
        c2_f = c2_mb_y + c2_shift;
        c2_lb_a = c2_sqds;
        c2_ab_b = c2_eqds;
        c2_g = c2_lb_a * c2_ab_b;
        c2_e_q = c2_b_q;
        for (c2_e_k = c2_e_q; c2_e_k <= c2_mm1; c2_e_k = c2_e_k + 1) {
          c2_b_k = c2_e_k;
          c2_mb_a = c2_b_k;
          c2_km1 = c2_mb_a - 1;
          c2_nb_a = c2_b_k;
          c2_kp1 = c2_nb_a + 1;
          c2_d_f = c2_f;
          c2_b_g = c2_g;
          c2_eml_xrotg(c2_d_f, c2_b_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          if (c2_b_k > c2_b_q) {
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 3, 1, 0) - 1] = c2_f;
          }

          c2_ob_a = c2_sn;
          c2_bb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_nb_y = c2_ob_a * c2_bb_b;
          c2_pb_a = c2_cs;
          c2_cb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_ob_y = c2_pb_a * c2_cb_b;
          c2_f = c2_ob_y + c2_nb_y;
          c2_qb_a = c2_sn;
          c2_db_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_pb_y = c2_qb_a * c2_db_b;
          c2_rb_a = c2_cs;
          c2_eb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_qb_y = c2_rb_a * c2_eb_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_qb_y - c2_pb_y;
          c2_sb_a = c2_sn;
          c2_fb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_g = c2_sb_a * c2_fb_b;
          c2_tb_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_gb_b = c2_cs;
          c2_rb_y = c2_tb_a * c2_gb_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 3, 1, 0) - 1] = c2_rb_y;
          c2_e_f = c2_f;
          c2_c_g = c2_g;
          c2_eml_xrotg(c2_e_f, c2_c_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_f;
          c2_ub_a = c2_sn;
          c2_hb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_sb_y = c2_ub_a * c2_hb_b;
          c2_vb_a = c2_cs;
          c2_ib_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_tb_y = c2_vb_a * c2_ib_b;
          c2_f = c2_tb_y + c2_sb_y;
          c2_wb_a = c2_cs;
          c2_jb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_ub_y = c2_wb_a * c2_jb_b;
          c2_xb_a = -c2_sn;
          c2_kb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_vb_y = c2_xb_a * c2_kb_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 3, 1, 0) - 1] = c2_vb_y + c2_ub_y;
          c2_yb_a = c2_sn;
          c2_lb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_g = c2_yb_a * c2_lb_b;
          c2_ac_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_mb_b = c2_cs;
          c2_wb_y = c2_ac_a * c2_mb_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 3, 1, 0) - 1] = c2_wb_y;
        }

        c2_bc_a = c2_m;
        c2_j_c = c2_bc_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_j_c), 1, 3, 1, 0) - 1] = c2_f;
        c2_iter = c2_iter + 1.0;
        break;

       case 4:
        if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] < 0.0) {
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 3, 1, 0) - 1] = -c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
            "s", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        }

        c2_cc_a = c2_b_q;
        c2_qp1 = c2_cc_a + 1;
       label_10:
        ;
        if (c2_b_q < 3) {
          if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
                (real_T)c2_b_q), 1, 3, 1, 0) - 1] < c2_s[
              _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1", (real_T)
                c2_qp1), 1, 3, 1, 0) - 1]) {
            c2_rt = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] =
              c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
              "s", _SFD_INTEGER_CHECK("qp1", (real_T)c2_qp1), 1, 3, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1",
              (real_T)c2_qp1), 1, 3, 1, 0) - 1] = c2_rt;
            c2_b_q = c2_qp1;
            c2_dc_a = c2_b_q;
            c2_qp1 = c2_dc_a + 1;
            goto label_10;
          }
        }

        c2_iter = 0.0;
        c2_ec_a = c2_m;
        c2_m = c2_ec_a - 1;
        break;
      }

      goto label_11;
    }
  }

  for (c2_i202 = 0; c2_i202 < 3; c2_i202 = c2_i202 + 1) {
    c2_Uout[c2_i202] = c2_s[c2_i202];
  }
}

static boolean_T c2_isfinite(real_T c2_x)
{
  real_T c2_b_x;
  boolean_T c2_b_b;
  boolean_T c2_b0;
  real_T c2_c_x;
  boolean_T c2_c_b;
  boolean_T c2_b1;
  c2_b_x = c2_x;
  c2_b_b = rtIsInf(c2_b_x);
  c2_b0 = !c2_b_b;
  c2_c_x = c2_x;
  c2_c_b = rtIsNaN(c2_c_x);
  c2_b1 = !c2_c_b;
  return c2_b0 && c2_b1;
}

static void c2_eml_error(void)
{
  int32_T c2_i203;
  static char_T c2_varargin_1[27] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's',
    'v', 'd', ':', 'm', 'a', 't', 'r', 'i', 'x', 'W', 'i',
    't', 'h', 'N', 'a', 'N', 'I', 'n', 'f' };

  char_T c2_u[27];
  const mxArray *c2_y = NULL;
  int32_T c2_i204;
  static char_T c2_varargin_2[41] = { 'I', 'n', 'p', 'u', 't', ' ', 't', 'o',
    ' ', 'S', 'V', 'D', ' ', 'm', 'u', 's', 't', ' ', 'n',
    'o', 't', ' ', 'c', 'o', 'n', 't', 'a', 'i', 'n', ' ', 'N', 'a', 'N', ' ',
    'o', 'r', ' ', 'I',
    'n', 'f', '.' };

  char_T c2_b_u[41];
  const mxArray *c2_b_y = NULL;
  for (c2_i203 = 0; c2_i203 < 27; c2_i203 = c2_i203 + 1) {
    c2_u[c2_i203] = c2_varargin_1[c2_i203];
  }

  c2_y = NULL;
  sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 10, 0U, 1U, 0U, 2, 1, 27));
  for (c2_i204 = 0; c2_i204 < 41; c2_i204 = c2_i204 + 1) {
    c2_b_u[c2_i204] = c2_varargin_2[c2_i204];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 10, 0U, 1U, 0U, 2, 1, 41));
  sf_mex_call("error", 0U, 2U, 14, c2_y, 14, c2_b_y);
}

static void c2_eml_zeros(real_T c2_x[3])
{
  int32_T c2_i205;
  for (c2_i205 = 0; c2_i205 < 3; c2_i205 = c2_i205 + 1) {
    c2_x[c2_i205] = 0.0;
  }
}

static void c2_b_eml_zeros(real_T c2_x[3])
{
  int32_T c2_i206;
  for (c2_i206 = 0; c2_i206 < 3; c2_i206 = c2_i206 + 1) {
    c2_x[c2_i206] = 0.0;
  }
}

static real_T c2_eml_xnrm2(int32_T c2_n, real_T c2_x[9], int32_T c2_ix0)
{
  real_T c2_y;
  int32_T c2_b_n;
  int32_T c2_i207;
  real_T c2_b_x[9];
  int32_T c2_b_ix0;
  int32_T c2_c_n;
  int32_T c2_i208;
  real_T c2_c_x[9];
  int32_T c2_c_ix0;
  real_T c2_scale;
  int32_T c2_d_x;
  int32_T c2_kstart;
  int32_T c2_a;
  int32_T c2_b_a;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_kend;
  int32_T c2_b_kstart;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_e_x;
  real_T c2_f_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_g_x;
  real_T c2_h_x;
  real_T c2_c_y;
  c2_b_n = c2_n;
  for (c2_i207 = 0; c2_i207 < 9; c2_i207 = c2_i207 + 1) {
    c2_b_x[c2_i207] = c2_x[c2_i207];
  }

  c2_b_ix0 = c2_ix0;
  c2_c_n = c2_b_n;
  for (c2_i208 = 0; c2_i208 < 9; c2_i208 = c2_i208 + 1) {
    c2_c_x[c2_i208] = c2_b_x[c2_i208];
  }

  c2_c_ix0 = c2_b_ix0;
  c2_y = 0.0;
  if ((real_T)c2_c_n < 1.0) {
  } else {
    c2_scale = 0.0;
    c2_d_x = c2_c_ix0;
    c2_kstart = c2_d_x;
    c2_a = c2_kstart;
    c2_b_a = c2_c_n;
    c2_c_a = c2_b_a - 1;
    c2_b = c2_c_a;
    c2_kend = c2_a + c2_b;
    c2_b_kstart = c2_kstart;
    for (c2_k = c2_b_kstart; c2_k <= c2_kend; c2_k = c2_k + 1) {
      c2_b_k = c2_k;
      c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
        (real_T)c2_b_k), 1, 9, 1, 0) - 1];
      if (c2_xk != 0.0) {
        c2_e_x = c2_xk;
        c2_f_x = c2_e_x;
        c2_b_y = muDoubleScalarAbs(c2_f_x);
        c2_absxk = c2_b_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }

      c2_xk = 0.0;
      if (c2_xk != 0.0) {
        c2_g_x = c2_xk;
        c2_h_x = c2_g_x;
        c2_c_y = muDoubleScalarAbs(c2_h_x);
        c2_absxk = c2_c_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }
    }

    return c2_scale * muDoubleScalarSqrt(c2_y);
  }

  return c2_y;
}

static void c2_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[9], int32_T
  c2_ix0, real_T c2_b_x[9])
{
  int32_T c2_i209;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i210;
  real_T c2_c_x[9];
  int32_T c2_b_ix0;
  int32_T c2_i211;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i212;
  real_T c2_d_x[9];
  int32_T c2_c_ix0;
  int32_T c2_i213;
  int32_T c2_e_x;
  int32_T c2_i214;
  int32_T c2_d_a;
  int32_T c2_e_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_b_k;
  for (c2_i209 = 0; c2_i209 < 9; c2_i209 = c2_i209 + 1) {
    c2_b_x[c2_i209] = c2_x[c2_i209];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i210 = 0; c2_i210 < 9; c2_i210 = c2_i210 + 1) {
    c2_c_x[c2_i210] = c2_b_x[c2_i210];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i211 = 0; c2_i211 < 9; c2_i211 = c2_i211 + 1) {
    c2_b_x[c2_i211] = c2_c_x[c2_i211];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i212 = 0; c2_i212 < 9; c2_i212 = c2_i212 + 1) {
    c2_d_x[c2_i212] = c2_b_x[c2_i212];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i213 = 0; c2_i213 < 9; c2_i213 = c2_i213 + 1) {
    c2_b_x[c2_i213] = c2_d_x[c2_i213];
  }

  c2_e_x = c2_c_ix0;
  c2_i214 = c2_e_x;
  c2_d_a = c2_c_ix0;
  c2_e_a = c2_c_n;
  c2_b = c2_e_a - 1;
  c2_b_b = c2_b;
  c2_loop_ub = c2_d_a + c2_b_b;
  for (c2_k = c2_i214; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)
      c2_b_k), 1, 9, 1, 0) - 1] = c2_c_a * c2_b_x[
      _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 9, 1, 0) - 1];
  }
}

static real_T c2_eml_xdotc(int32_T c2_n, real_T c2_x[9], int32_T c2_ix0, real_T
  c2_y[9], int32_T c2_iy0)
{
  real_T c2_d;
  int32_T c2_b_n;
  int32_T c2_i215;
  real_T c2_b_x[9];
  int32_T c2_b_ix0;
  int32_T c2_i216;
  real_T c2_b_y[9];
  int32_T c2_b_iy0;
  int32_T c2_c_n;
  int32_T c2_i217;
  real_T c2_c_x[9];
  int32_T c2_c_ix0;
  int32_T c2_i218;
  real_T c2_c_y[9];
  int32_T c2_c_iy0;
  int32_T c2_d_n;
  int32_T c2_i219;
  real_T c2_d_x[9];
  int32_T c2_d_ix0;
  int32_T c2_i220;
  real_T c2_d_y[9];
  int32_T c2_d_iy0;
  int32_T c2_e_n;
  int32_T c2_i221;
  real_T c2_e_x[9];
  int32_T c2_e_ix0;
  int32_T c2_i222;
  real_T c2_e_y[9];
  int32_T c2_e_iy0;
  int32_T c2_f_x;
  int32_T c2_ix;
  int32_T c2_g_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_a;
  int32_T c2_b_a;
  c2_b_n = c2_n;
  for (c2_i215 = 0; c2_i215 < 9; c2_i215 = c2_i215 + 1) {
    c2_b_x[c2_i215] = c2_x[c2_i215];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i216 = 0; c2_i216 < 9; c2_i216 = c2_i216 + 1) {
    c2_b_y[c2_i216] = c2_y[c2_i216];
  }

  c2_b_iy0 = c2_iy0;
  c2_c_n = c2_b_n;
  for (c2_i217 = 0; c2_i217 < 9; c2_i217 = c2_i217 + 1) {
    c2_c_x[c2_i217] = c2_b_x[c2_i217];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i218 = 0; c2_i218 < 9; c2_i218 = c2_i218 + 1) {
    c2_c_y[c2_i218] = c2_b_y[c2_i218];
  }

  c2_c_iy0 = c2_b_iy0;
  c2_d_n = c2_c_n;
  for (c2_i219 = 0; c2_i219 < 9; c2_i219 = c2_i219 + 1) {
    c2_d_x[c2_i219] = c2_c_x[c2_i219];
  }

  c2_d_ix0 = c2_c_ix0;
  for (c2_i220 = 0; c2_i220 < 9; c2_i220 = c2_i220 + 1) {
    c2_d_y[c2_i220] = c2_c_y[c2_i220];
  }

  c2_d_iy0 = c2_c_iy0;
  c2_e_n = c2_d_n;
  for (c2_i221 = 0; c2_i221 < 9; c2_i221 = c2_i221 + 1) {
    c2_e_x[c2_i221] = c2_d_x[c2_i221];
  }

  c2_e_ix0 = c2_d_ix0;
  for (c2_i222 = 0; c2_i222 < 9; c2_i222 = c2_i222 + 1) {
    c2_e_y[c2_i222] = c2_d_y[c2_i222];
  }

  c2_e_iy0 = c2_d_iy0;
  c2_d = 0.0;
  if ((real_T)c2_e_n < 1.0) {
  } else {
    c2_f_x = c2_e_ix0;
    c2_ix = c2_f_x;
    c2_g_x = c2_e_iy0;
    c2_iy = c2_g_x;
    c2_loop_ub = c2_e_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_d = c2_d + c2_e_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK(
        "ix", (real_T)c2_ix), 1, 9, 1, 0) - 1] * c2_e_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 9, 1, 0) - 1];
      c2_a = c2_iy;
      c2_iy = c2_a + 1;
      c2_b_a = c2_ix;
      c2_ix = c2_b_a + 1;
    }
  }

  return c2_d;
}

static void c2_eml_xaxpy(int32_T c2_n, real_T c2_a, int32_T c2_ix0, real_T c2_y
  [9], int32_T c2_iy0, real_T c2_b_y[9])
{
  int32_T c2_i223;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_b_ix0;
  int32_T c2_i224;
  real_T c2_c_y[9];
  int32_T c2_b_iy0;
  int32_T c2_i225;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_c_ix0;
  int32_T c2_i226;
  real_T c2_d_y[9];
  int32_T c2_c_iy0;
  int32_T c2_i227;
  int32_T c2_x;
  int32_T c2_ix;
  int32_T c2_b_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i223 = 0; c2_i223 < 9; c2_i223 = c2_i223 + 1) {
    c2_b_y[c2_i223] = c2_y[c2_i223];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  c2_b_ix0 = c2_ix0;
  for (c2_i224 = 0; c2_i224 < 9; c2_i224 = c2_i224 + 1) {
    c2_c_y[c2_i224] = c2_b_y[c2_i224];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i225 = 0; c2_i225 < 9; c2_i225 = c2_i225 + 1) {
    c2_b_y[c2_i225] = c2_c_y[c2_i225];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  c2_c_ix0 = c2_b_ix0;
  for (c2_i226 = 0; c2_i226 < 9; c2_i226 = c2_i226 + 1) {
    c2_d_y[c2_i226] = c2_b_y[c2_i226];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i227 = 0; c2_i227 < 9; c2_i227 = c2_i227 + 1) {
    c2_b_y[c2_i227] = c2_d_y[c2_i227];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_x = c2_c_ix0;
    c2_ix = c2_x;
    c2_b_x = c2_c_iy0;
    c2_iy = c2_b_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 9, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 9, 1, 0) - 1] + c2_c_a * c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 9, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static real_T c2_b_eml_xnrm2(int32_T c2_n, real_T c2_x[3], int32_T c2_ix0)
{
  real_T c2_y;
  int32_T c2_b_n;
  int32_T c2_i228;
  real_T c2_b_x[3];
  int32_T c2_b_ix0;
  int32_T c2_c_n;
  int32_T c2_i229;
  real_T c2_c_x[3];
  int32_T c2_c_ix0;
  real_T c2_scale;
  int32_T c2_d_x;
  int32_T c2_kstart;
  int32_T c2_a;
  int32_T c2_b_a;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_kend;
  int32_T c2_b_kstart;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_e_x;
  real_T c2_f_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_g_x;
  real_T c2_h_x;
  real_T c2_c_y;
  c2_b_n = c2_n;
  for (c2_i228 = 0; c2_i228 < 3; c2_i228 = c2_i228 + 1) {
    c2_b_x[c2_i228] = c2_x[c2_i228];
  }

  c2_b_ix0 = c2_ix0;
  c2_c_n = c2_b_n;
  for (c2_i229 = 0; c2_i229 < 3; c2_i229 = c2_i229 + 1) {
    c2_c_x[c2_i229] = c2_b_x[c2_i229];
  }

  c2_c_ix0 = c2_b_ix0;
  c2_y = 0.0;
  if ((real_T)c2_c_n < 1.0) {
  } else {
    c2_scale = 0.0;
    c2_d_x = c2_c_ix0;
    c2_kstart = c2_d_x;
    c2_a = c2_kstart;
    c2_b_a = c2_c_n;
    c2_c_a = c2_b_a - 1;
    c2_b = c2_c_a;
    c2_kend = c2_a + c2_b;
    c2_b_kstart = c2_kstart;
    for (c2_k = c2_b_kstart; c2_k <= c2_kend; c2_k = c2_k + 1) {
      c2_b_k = c2_k;
      c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
        (real_T)c2_b_k), 1, 3, 1, 0) - 1];
      if (c2_xk != 0.0) {
        c2_e_x = c2_xk;
        c2_f_x = c2_e_x;
        c2_b_y = muDoubleScalarAbs(c2_f_x);
        c2_absxk = c2_b_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }

      c2_xk = 0.0;
      if (c2_xk != 0.0) {
        c2_g_x = c2_xk;
        c2_h_x = c2_g_x;
        c2_c_y = muDoubleScalarAbs(c2_h_x);
        c2_absxk = c2_c_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }
    }

    return c2_scale * muDoubleScalarSqrt(c2_y);
  }

  return c2_y;
}

static void c2_b_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_b_x[3])
{
  int32_T c2_i230;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i231;
  real_T c2_c_x[3];
  int32_T c2_b_ix0;
  int32_T c2_i232;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i233;
  real_T c2_d_x[3];
  int32_T c2_c_ix0;
  int32_T c2_i234;
  int32_T c2_e_x;
  int32_T c2_i235;
  int32_T c2_d_a;
  int32_T c2_e_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_b_k;
  for (c2_i230 = 0; c2_i230 < 3; c2_i230 = c2_i230 + 1) {
    c2_b_x[c2_i230] = c2_x[c2_i230];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i231 = 0; c2_i231 < 3; c2_i231 = c2_i231 + 1) {
    c2_c_x[c2_i231] = c2_b_x[c2_i231];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i232 = 0; c2_i232 < 3; c2_i232 = c2_i232 + 1) {
    c2_b_x[c2_i232] = c2_c_x[c2_i232];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i233 = 0; c2_i233 < 3; c2_i233 = c2_i233 + 1) {
    c2_d_x[c2_i233] = c2_b_x[c2_i233];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i234 = 0; c2_i234 < 3; c2_i234 = c2_i234 + 1) {
    c2_b_x[c2_i234] = c2_d_x[c2_i234];
  }

  c2_e_x = c2_c_ix0;
  c2_i235 = c2_e_x;
  c2_d_a = c2_c_ix0;
  c2_e_a = c2_c_n;
  c2_b = c2_e_a - 1;
  c2_b_b = c2_b;
  c2_loop_ub = c2_d_a + c2_b_b;
  for (c2_k = c2_i235; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)
      c2_b_k), 1, 3, 1, 0) - 1] = c2_c_a * c2_b_x[
      _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 3, 1, 0) - 1];
  }
}

static void c2_b_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[9], int32_T
  c2_ix0, real_T c2_y[3], int32_T c2_iy0, real_T c2_b_y[
  3])
{
  int32_T c2_i236;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i237;
  real_T c2_b_x[9];
  int32_T c2_b_ix0;
  int32_T c2_i238;
  real_T c2_c_y[3];
  int32_T c2_b_iy0;
  int32_T c2_i239;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i240;
  real_T c2_c_x[9];
  int32_T c2_c_ix0;
  int32_T c2_i241;
  real_T c2_d_y[3];
  int32_T c2_c_iy0;
  int32_T c2_i242;
  int32_T c2_d_x;
  int32_T c2_ix;
  int32_T c2_e_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i236 = 0; c2_i236 < 3; c2_i236 = c2_i236 + 1) {
    c2_b_y[c2_i236] = c2_y[c2_i236];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i237 = 0; c2_i237 < 9; c2_i237 = c2_i237 + 1) {
    c2_b_x[c2_i237] = c2_x[c2_i237];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i238 = 0; c2_i238 < 3; c2_i238 = c2_i238 + 1) {
    c2_c_y[c2_i238] = c2_b_y[c2_i238];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i239 = 0; c2_i239 < 3; c2_i239 = c2_i239 + 1) {
    c2_b_y[c2_i239] = c2_c_y[c2_i239];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i240 = 0; c2_i240 < 9; c2_i240 = c2_i240 + 1) {
    c2_c_x[c2_i240] = c2_b_x[c2_i240];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i241 = 0; c2_i241 < 3; c2_i241 = c2_i241 + 1) {
    c2_d_y[c2_i241] = c2_b_y[c2_i241];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i242 = 0; c2_i242 < 3; c2_i242 = c2_i242 + 1) {
    c2_b_y[c2_i242] = c2_d_y[c2_i242];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_d_x = c2_c_ix0;
    c2_ix = c2_d_x;
    c2_e_x = c2_c_iy0;
    c2_iy = c2_e_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 3, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 3, 1, 0) - 1] + c2_c_a * c2_c_x[
        _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 9, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static void c2_c_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_y[9], int32_T c2_iy0, real_T c2_b_y[
  9])
{
  int32_T c2_i243;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i244;
  real_T c2_b_x[3];
  int32_T c2_b_ix0;
  int32_T c2_i245;
  real_T c2_c_y[9];
  int32_T c2_b_iy0;
  int32_T c2_i246;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i247;
  real_T c2_c_x[3];
  int32_T c2_c_ix0;
  int32_T c2_i248;
  real_T c2_d_y[9];
  int32_T c2_c_iy0;
  int32_T c2_i249;
  int32_T c2_d_x;
  int32_T c2_ix;
  int32_T c2_e_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i243 = 0; c2_i243 < 9; c2_i243 = c2_i243 + 1) {
    c2_b_y[c2_i243] = c2_y[c2_i243];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i244 = 0; c2_i244 < 3; c2_i244 = c2_i244 + 1) {
    c2_b_x[c2_i244] = c2_x[c2_i244];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i245 = 0; c2_i245 < 9; c2_i245 = c2_i245 + 1) {
    c2_c_y[c2_i245] = c2_b_y[c2_i245];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i246 = 0; c2_i246 < 9; c2_i246 = c2_i246 + 1) {
    c2_b_y[c2_i246] = c2_c_y[c2_i246];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i247 = 0; c2_i247 < 3; c2_i247 = c2_i247 + 1) {
    c2_c_x[c2_i247] = c2_b_x[c2_i247];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i248 = 0; c2_i248 < 9; c2_i248 = c2_i248 + 1) {
    c2_d_y[c2_i248] = c2_b_y[c2_i248];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i249 = 0; c2_i249 < 9; c2_i249 = c2_i249 + 1) {
    c2_b_y[c2_i249] = c2_d_y[c2_i249];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_d_x = c2_c_ix0;
    c2_ix = c2_d_x;
    c2_e_x = c2_c_iy0;
    c2_iy = c2_e_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 9, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 9, 1, 0) - 1] + c2_c_a * c2_c_x[
        _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 3, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static void c2_b_eml_error(void)
{
  int32_T c2_i250;
  static char_T c2_varargin_1[32] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd',
    'M', 'A', 'T', 'L', 'A', 'B', ':', 'p', 'o', 'w', 'e',
    'r', ':', 'd', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' };

  char_T c2_u[32];
  const mxArray *c2_y = NULL;
  int32_T c2_i251;
  static char_T c2_varargin_2[102] = { 'D', 'o', 'm', 'a', 'i', 'n', ' ', 'e',
    'r', 'r', 'o', 'r', '.', ' ', 'T', 'o', ' ', 'c', 'o',
    'm', 'p', 'u', 't', 'e', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ' ', 'r',
    'e', 's', 'u', 'l',
    't', 's', ',', ' ', 'm', 'a', 'k', 'e', ' ', 'a', 't', ' ', 'l', 'e', 'a',
    's', 't', ' ', 'o',
    'n', 'e', ' ', 'i', 'n', 'p', 'u', 't', ' ', 'c', 'o', 'm', 'p', 'l', 'e',
    'x', ',', ' ', 'e',
    '.', 'g', '.', ' ', '\'', 'p', 'o', 'w', 'e', 'r', '(', 'c', 'o', 'm', 'p',
    'l', 'e', 'x', '('
    , 'a', ')', ',', 'b', ')', '\'', '.' };

  char_T c2_b_u[102];
  const mxArray *c2_b_y = NULL;
  for (c2_i250 = 0; c2_i250 < 32; c2_i250 = c2_i250 + 1) {
    c2_u[c2_i250] = c2_varargin_1[c2_i250];
  }

  c2_y = NULL;
  sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 10, 0U, 1U, 0U, 2, 1, 32));
  for (c2_i251 = 0; c2_i251 < 102; c2_i251 = c2_i251 + 1) {
    c2_b_u[c2_i251] = c2_varargin_2[c2_i251];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 10, 0U, 1U, 0U, 2, 1, 102));
  sf_mex_call("error", 0U, 2U, 14, c2_y, 14, c2_b_y);
}

static real_T c2_max(real_T c2_varargin_1, real_T c2_varargin_2)
{
  real_T c2_x;
  real_T c2_y;
  real_T c2_b_x;
  real_T c2_b_y;
  real_T c2_xk;
  real_T c2_yk;
  real_T c2_c_x;
  real_T c2_c_y;
  real_T c2_rx;
  real_T c2_ry;
  real_T c2_d_x;
  boolean_T c2_b;
  real_T c2_extremum;
  c2_x = c2_varargin_1;
  c2_y = c2_varargin_2;
  c2_b_x = c2_x;
  c2_b_y = c2_y;
  c2_xk = c2_b_x;
  c2_yk = c2_b_y;
  c2_c_x = c2_xk;
  c2_c_y = c2_yk;
  c2_rx = c2_xk;
  c2_ry = c2_yk;
  if (c2_rx >= c2_ry) {
  } else {
    c2_d_x = c2_ry;
    c2_b = rtIsNaN(c2_d_x);
    if (c2_b) {
    } else {
      c2_extremum = c2_c_y;
      goto label_1;
    }
  }

  c2_extremum = c2_c_x;
 label_1:
  ;
  return c2_extremum;
}

static void c2_c_eml_error(void)
{
  int32_T c2_i252;
  static char_T c2_varargin_1[24] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 's',
    'v', 'd', ':', 'N', 'o', 'C', 'o', 'n', 'v', 'e', 'r',
    'g', 'e', 'n', 'c', 'e' };

  char_T c2_u[24];
  const mxArray *c2_y = NULL;
  int32_T c2_i253;
  static char_T c2_varargin_2[21] = { 'S', 'V', 'D', ' ', 'f', 'a', 'i', 'l',
    's', ' ', 't', 'o', ' ', 'c', 'o', 'n', 'v', 'e', 'r',
    'g', 'e' };

  char_T c2_b_u[21];
  const mxArray *c2_b_y = NULL;
  for (c2_i252 = 0; c2_i252 < 24; c2_i252 = c2_i252 + 1) {
    c2_u[c2_i252] = c2_varargin_1[c2_i252];
  }

  c2_y = NULL;
  sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 10, 0U, 1U, 0U, 2, 1, 24));
  for (c2_i253 = 0; c2_i253 < 21; c2_i253 = c2_i253 + 1) {
    c2_b_u[c2_i253] = c2_varargin_2[c2_i253];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 10, 0U, 1U, 0U, 2, 1, 21));
  sf_mex_call("error", 0U, 2U, 14, c2_y, 14, c2_b_y);
}

static real_T c2_b_max(real_T c2_varargin_1[5])
{
  int32_T c2_i254;
  real_T c2_x[5];
  int32_T c2_i255;
  real_T c2_b_x[5];
  real_T c2_mtmp;
  int32_T c2_ix;
  int32_T c2_k;
  int32_T c2_a;
  real_T c2_c_x;
  boolean_T c2_b;
  real_T c2_d_x;
  boolean_T c2_b_b;
  for (c2_i254 = 0; c2_i254 < 5; c2_i254 = c2_i254 + 1) {
    c2_x[c2_i254] = c2_varargin_1[c2_i254];
  }

  for (c2_i255 = 0; c2_i255 < 5; c2_i255 = c2_i255 + 1) {
    c2_b_x[c2_i255] = c2_x[c2_i255];
  }

  c2_mtmp = c2_b_x[0];
  c2_ix = 1;
  for (c2_k = 2; c2_k < 6; c2_k = c2_k + 1) {
    c2_a = c2_ix;
    c2_ix = c2_a + 1;
    c2_c_x = c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix",
      (real_T)c2_ix), 1, 5, 1, 0) - 1];
    c2_b = rtIsNaN(c2_c_x);
    if (!c2_b) {
      c2_d_x = c2_mtmp;
      c2_b_b = rtIsNaN(c2_d_x);
      if (c2_b_b) {
        goto label_1;
      } else {
        if (c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix",
              (real_T)c2_ix), 1, 5, 1, 0) - 1] > c2_mtmp) {
          goto label_1;
        }
      }
    }

    goto label_2;
   label_1:
    ;
    c2_mtmp = c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix",
      (real_T)c2_ix), 1, 5, 1, 0) - 1];
   label_2:
    ;
  }

  return c2_mtmp;
}

static real_T c2_sqrt(real_T c2_x)
{
  real_T c2_b_x;
  real_T c2_c_x;
  real_T c2_d_x;
  c2_b_x = c2_x;
  if (c2_b_x < 0.0) {
    c2_d_eml_error();
  }

  c2_c_x = c2_b_x;
  c2_d_x = c2_c_x;
  c2_d_x = muDoubleScalarSqrt(c2_d_x);
  return c2_d_x;
}

static void c2_d_eml_error(void)
{
  int32_T c2_i256;
  static char_T c2_varargin_1[31] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd',
    'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'q', 'r', 't',
    ':', 'd', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' };

  char_T c2_u[31];
  const mxArray *c2_y = NULL;
  int32_T c2_i257;
  static char_T c2_varargin_2[77] = { 'D', 'o', 'm', 'a', 'i', 'n', ' ', 'e',
    'r', 'r', 'o', 'r', '.', ' ', 'T', 'o', ' ', 'c', 'o',
    'm', 'p', 'u', 't', 'e', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ' ', 'r',
    'e', 's', 'u', 'l',
    't', 's', ' ', 'f', 'r', 'o', 'm', ' ', 'r', 'e', 'a', 'l', ' ', 'x', ',',
    ' ', 'u', 's', 'e',
    ' ', '\'', 's', 'q', 'r', 't', '(', 'c', 'o', 'm', 'p', 'l', 'e', 'x', '(',
    'x', ')', ')', '\''
    , '.' };

  char_T c2_b_u[77];
  const mxArray *c2_b_y = NULL;
  for (c2_i256 = 0; c2_i256 < 31; c2_i256 = c2_i256 + 1) {
    c2_u[c2_i256] = c2_varargin_1[c2_i256];
  }

  c2_y = NULL;
  sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 10, 0U, 1U, 0U, 2, 1, 31));
  for (c2_i257 = 0; c2_i257 < 77; c2_i257 = c2_i257 + 1) {
    c2_b_u[c2_i257] = c2_varargin_2[c2_i257];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 10, 0U, 1U, 0U, 2, 1, 77));
  sf_mex_call("error", 0U, 2U, 14, c2_y, 14, c2_b_y);
}

static void c2_eml_xrotg(real_T c2_a, real_T c2_b, real_T *c2_b_a, real_T
  *c2_b_b, real_T *c2_c, real_T *c2_s)
{
  real_T c2_c_a;
  real_T c2_c_b;
  real_T c2_d_b;
  real_T c2_d_a;
  real_T c2_e_a;
  real_T c2_e_b;
  real_T c2_f_b;
  real_T c2_f_a;
  real_T c2_roe;
  real_T c2_x;
  real_T c2_b_x;
  real_T c2_y;
  real_T c2_absa;
  real_T c2_c_x;
  real_T c2_d_x;
  real_T c2_b_y;
  real_T c2_absb;
  real_T c2_scale;
  real_T c2_b_s;
  real_T c2_b_c;
  real_T c2_A;
  real_T c2_B;
  real_T c2_e_x;
  real_T c2_c_y;
  real_T c2_f_x;
  real_T c2_d_y;
  real_T c2_g_x;
  real_T c2_e_y;
  real_T c2_ads;
  real_T c2_b_A;
  real_T c2_b_B;
  real_T c2_h_x;
  real_T c2_f_y;
  real_T c2_i_x;
  real_T c2_g_y;
  real_T c2_j_x;
  real_T c2_h_y;
  real_T c2_bds;
  real_T c2_k_x;
  real_T c2_l_x;
  real_T c2_m_x;
  real_T c2_n_x;
  real_T c2_r;
  real_T c2_c_A;
  real_T c2_c_B;
  real_T c2_o_x;
  real_T c2_i_y;
  real_T c2_p_x;
  real_T c2_j_y;
  real_T c2_q_x;
  real_T c2_k_y;
  real_T c2_d_A;
  real_T c2_d_B;
  real_T c2_r_x;
  real_T c2_l_y;
  real_T c2_s_x;
  real_T c2_m_y;
  real_T c2_t_x;
  real_T c2_n_y;
  real_T c2_e_B;
  real_T c2_o_y;
  real_T c2_p_y;
  real_T c2_q_y;
  real_T c2_c_c;
  real_T c2_c_s;
  *c2_b_b = c2_b;
  *c2_b_a = c2_a;
  c2_c_a = *c2_b_a;
  c2_c_b = *c2_b_b;
  c2_d_b = c2_c_b;
  c2_d_a = c2_c_a;
  c2_e_a = c2_d_a;
  c2_e_b = c2_d_b;
  c2_f_b = c2_e_b;
  c2_f_a = c2_e_a;
  c2_roe = c2_f_b;
  c2_x = c2_f_a;
  c2_b_x = c2_x;
  c2_y = muDoubleScalarAbs(c2_b_x);
  c2_absa = c2_y;
  c2_c_x = c2_f_b;
  c2_d_x = c2_c_x;
  c2_b_y = muDoubleScalarAbs(c2_d_x);
  c2_absb = c2_b_y;
  if (c2_absa > c2_absb) {
    c2_roe = c2_f_a;
  }

  c2_scale = c2_absa + c2_absb;
  if (c2_scale == 0.0) {
    c2_b_s = 0.0;
    c2_b_c = 1.0;
    c2_f_a = 0.0;
    c2_f_b = 0.0;
  } else {
    c2_A = c2_absa;
    c2_B = c2_scale;
    c2_e_x = c2_A;
    c2_c_y = c2_B;
    if (c2_c_y == 0.0) {
      c2_eml_warning();
    }

    c2_f_x = c2_e_x;
    c2_d_y = c2_c_y;
    c2_g_x = c2_f_x;
    c2_e_y = c2_d_y;
    c2_ads = c2_g_x / c2_e_y;
    c2_b_A = c2_absb;
    c2_b_B = c2_scale;
    c2_h_x = c2_b_A;
    c2_f_y = c2_b_B;
    if (c2_f_y == 0.0) {
      c2_eml_warning();
    }

    c2_i_x = c2_h_x;
    c2_g_y = c2_f_y;
    c2_j_x = c2_i_x;
    c2_h_y = c2_g_y;
    c2_bds = c2_j_x / c2_h_y;
    c2_k_x = c2_ads * c2_ads + c2_bds * c2_bds;
    c2_l_x = c2_k_x;
    if (c2_l_x < 0.0) {
      c2_d_eml_error();
    }

    c2_m_x = c2_l_x;
    c2_n_x = c2_m_x;
    c2_n_x = muDoubleScalarSqrt(c2_n_x);
    c2_l_x = c2_n_x;
    c2_r = c2_scale * c2_l_x;
    if (c2_roe < 0.0) {
      c2_r = -c2_r;
    }

    c2_c_A = c2_f_a;
    c2_c_B = c2_r;
    c2_o_x = c2_c_A;
    c2_i_y = c2_c_B;
    if (c2_i_y == 0.0) {
      c2_eml_warning();
    }

    c2_p_x = c2_o_x;
    c2_j_y = c2_i_y;
    c2_q_x = c2_p_x;
    c2_k_y = c2_j_y;
    c2_b_c = c2_q_x / c2_k_y;
    c2_d_A = c2_f_b;
    c2_d_B = c2_r;
    c2_r_x = c2_d_A;
    c2_l_y = c2_d_B;
    if (c2_l_y == 0.0) {
      c2_eml_warning();
    }

    c2_s_x = c2_r_x;
    c2_m_y = c2_l_y;
    c2_t_x = c2_s_x;
    c2_n_y = c2_m_y;
    c2_b_s = c2_t_x / c2_n_y;
    if (c2_absa > c2_absb) {
      c2_f_b = c2_b_s;
    } else if (c2_b_c != 0.0) {
      c2_e_B = c2_b_c;
      c2_o_y = c2_e_B;
      if (c2_o_y == 0.0) {
        c2_eml_warning();
      }

      c2_p_y = c2_o_y;
      c2_q_y = c2_p_y;
      c2_f_b = 1.0 / c2_q_y;
    } else {
      c2_f_b = 1.0;
    }

    c2_f_a = c2_r;
  }

  c2_d_a = c2_f_a;
  c2_d_b = c2_f_b;
  c2_c_c = c2_b_c;
  c2_c_s = c2_b_s;
  *c2_b_a = c2_d_a;
  *c2_b_b = c2_d_b;
  *c2_c = c2_c_c;
  *c2_s = c2_c_s;
}

static void c2_eml_warning(void)
{
  int32_T c2_i258;
  static char_T c2_varargin_1[19] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 'd',
    'i', 'v', 'i', 'd', 'e', 'B', 'y', 'Z', 'e', 'r', 'o' };

  char_T c2_u[19];
  const mxArray *c2_y = NULL;
  int32_T c2_i259;
  static char_T c2_varargin_2[15] = { 'D', 'i', 'v', 'i', 'd', 'e', ' ', 'b',
    'y', ' ', 'z', 'e', 'r', 'o', '.' };

  char_T c2_b_u[15];
  const mxArray *c2_b_y = NULL;
  for (c2_i258 = 0; c2_i258 < 19; c2_i258 = c2_i258 + 1) {
    c2_u[c2_i258] = c2_varargin_1[c2_i258];
  }

  c2_y = NULL;
  sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 10, 0U, 1U, 0U, 2, 1, 19));
  for (c2_i259 = 0; c2_i259 < 15; c2_i259 = c2_i259 + 1) {
    c2_b_u[c2_i259] = c2_varargin_2[c2_i259];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 10, 0U, 1U, 0U, 2, 1, 15));
  sf_mex_call("warning", 0U, 2U, 14, c2_y, 14, c2_b_y);
}

static real_T c2_c_norm(real_T c2_x[3])
{
  int32_T c2_i260;
  real_T c2_b_x[3];
  for (c2_i260 = 0; c2_i260 < 3; c2_i260 = c2_i260 + 1) {
    c2_b_x[c2_i260] = c2_x[c2_i260];
  }

  return c2_genpnorm(c2_b_x, 2.0);
}

static real_T c2_genpnorm(real_T c2_x[3], real_T c2_p)
{
  real_T c2_y;
  int32_T c2_i261;
  real_T c2_b_x[3];
  real_T c2_k;
  real_T c2_b_k;
  real_T c2_c_x;
  real_T c2_d_x;
  real_T c2_b_y;
  real_T c2_absx;
  real_T c2_e_x;
  boolean_T c2_b;
  real_T c2_c_k;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  real_T c2_d_y;
  real_T c2_d_k;
  real_T c2_h_x;
  real_T c2_i_x;
  real_T c2_e_y;
  real_T c2_j_x;
  boolean_T c2_b_b;
  int32_T c2_i262;
  real_T c2_k_x[3];
  real_T c2_b_p;
  real_T c2_scale;
  real_T c2_e_k;
  real_T c2_f_k;
  real_T c2_l_x;
  real_T c2_m_x;
  real_T c2_f_y;
  real_T c2_b_absx;
  real_T c2_n_x;
  boolean_T c2_c_b;
  real_T c2_o_x;
  boolean_T c2_d_b;
  real_T c2_d5;
  real_T c2_j;
  real_T c2_b_j;
  real_T c2_p_x;
  boolean_T c2_e_b;
  real_T c2_a;
  real_T c2_b_a;
  real_T c2_f_b;
  real_T c2_ak;
  real_T c2_bk;
  real_T c2_q_x;
  real_T c2_r_x;
  real_T c2_g_b;
  real_T c2_g_y;
  real_T c2_c_a;
  real_T c2_h_b;
  real_T c2_b_ak;
  real_T c2_b_bk;
  real_T c2_s_x;
  real_T c2_t_x;
  real_T c2_h_y;
  real_T c2_u_x;
  boolean_T c2_i_b;
  real_T c2_d_a;
  real_T c2_e_a;
  real_T c2_j_b;
  real_T c2_c_ak;
  real_T c2_c_bk;
  real_T c2_v_x;
  real_T c2_w_x;
  real_T c2_k_b;
  int32_T c2_i263;
  real_T c2_x_x[3];
  real_T c2_c_p;
  real_T c2_b_scale;
  real_T c2_g_k;
  real_T c2_h_k;
  real_T c2_y_x;
  real_T c2_ab_x;
  real_T c2_i_y;
  real_T c2_c_absx;
  real_T c2_bb_x;
  boolean_T c2_l_b;
  real_T c2_d6;
  real_T c2_c_j;
  real_T c2_d_j;
  real_T c2_cb_x;
  boolean_T c2_m_b;
  real_T c2_f_a;
  real_T c2_g_a;
  real_T c2_n_b;
  real_T c2_d_ak;
  real_T c2_d_bk;
  real_T c2_db_x;
  real_T c2_eb_x;
  real_T c2_o_b;
  real_T c2_j_y;
  real_T c2_fb_x;
  boolean_T c2_p_b;
  real_T c2_h_a;
  real_T c2_q_b;
  real_T c2_e_ak;
  real_T c2_e_bk;
  real_T c2_gb_x;
  real_T c2_hb_x;
  real_T c2_k_y;
  real_T c2_ib_x;
  boolean_T c2_r_b;
  real_T c2_i_a;
  real_T c2_s_b;
  if (c2_p == 2.0) {
    for (c2_i261 = 0; c2_i261 < 3; c2_i261 = c2_i261 + 1) {
      c2_b_x[c2_i261] = c2_x[c2_i261];
    }

    return c2_c_eml_xnrm2(c2_b_x);
  } else if (c2_p == rtInf) {
    c2_y = 0.0;
    c2_k = 1.0;
   label_1:
    ;
    if (c2_k <= 3.0) {
      c2_b_k = c2_k;
      c2_c_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_d_x = c2_c_x;
      c2_b_y = muDoubleScalarAbs(c2_d_x);
      c2_absx = c2_b_y;
      c2_e_x = c2_absx;
      c2_b = rtIsNaN(c2_e_x);
      if (c2_b) {
        return rtNaN;
      } else {
        if (c2_absx > c2_y) {
          c2_y = c2_absx;
        }

        c2_k = c2_k + 1.0;
        goto label_1;
      }
    }
  } else if (c2_p == 1.0) {
    c2_y = 0.0;
    for (c2_c_k = 1.0; c2_c_k <= 3.0; c2_c_k = c2_c_k + 1.0) {
      c2_b_k = c2_c_k;
      c2_f_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_d_y = c2_c_y;
      c2_y = c2_y + c2_d_y;
    }
  } else if (c2_p == rtMinusInf) {
    c2_y = rtInf;
    c2_d_k = 1.0;
   label_2:
    ;
    if (c2_d_k <= 3.0) {
      c2_b_k = c2_d_k;
      c2_h_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_i_x = c2_h_x;
      c2_e_y = muDoubleScalarAbs(c2_i_x);
      c2_absx = c2_e_y;
      c2_j_x = c2_absx;
      c2_b_b = rtIsNaN(c2_j_x);
      if (c2_b_b) {
        return rtNaN;
      } else {
        if (c2_absx < c2_y) {
          c2_y = c2_absx;
        }

        c2_d_k = c2_d_k + 1.0;
        goto label_2;
      }
    }
  } else if (c2_p > 0.0) {
    for (c2_i262 = 0; c2_i262 < 3; c2_i262 = c2_i262 + 1) {
      c2_k_x[c2_i262] = c2_x[c2_i262];
    }

    c2_b_p = c2_p;
    c2_y = 0.0;
    c2_scale = 0.0;
    c2_e_k = 1.0;
   label_5:
    ;
    if (c2_e_k <= 3.0) {
      c2_f_k = c2_e_k;
      c2_l_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_f_k), 1, 3, 1, 0) - 1];
      c2_m_x = c2_l_x;
      c2_f_y = muDoubleScalarAbs(c2_m_x);
      c2_b_absx = c2_f_y;
      c2_n_x = c2_b_absx;
      c2_c_b = rtIsNaN(c2_n_x);
      if (c2_c_b) {
        return rtNaN;
      } else {
        c2_o_x = c2_b_absx;
        c2_d_b = rtIsInf(c2_o_x);
        if (c2_d_b) {
          c2_y = rtInf;
          c2_d5 = c2_f_k + 1.0;
          c2_j = c2_d5;
        } else {
          if (c2_b_absx > 0.0) {
            if (c2_scale < c2_b_absx) {
              c2_a = c2_y;
              c2_b_a = c2_scale / c2_b_absx;
              c2_f_b = c2_b_p;
              c2_ak = c2_b_a;
              c2_bk = c2_f_b;
              if (c2_ak < 0.0) {
                c2_q_x = c2_bk;
                c2_r_x = c2_q_x;
                c2_r_x = muDoubleScalarFloor(c2_r_x);
                if (c2_r_x != c2_bk) {
                  c2_b_eml_error();
                  goto label_3;
                }
              }

             label_3:
              ;
              c2_g_b = muDoubleScalarPower(c2_ak, c2_bk);
              c2_g_y = c2_a * c2_g_b;
              c2_y = 1.0 + c2_g_y;
              c2_scale = c2_b_absx;
            } else {
              c2_c_a = c2_b_absx / c2_scale;
              c2_h_b = c2_b_p;
              c2_b_ak = c2_c_a;
              c2_b_bk = c2_h_b;
              if (c2_b_ak < 0.0) {
                c2_s_x = c2_b_bk;
                c2_t_x = c2_s_x;
                c2_t_x = muDoubleScalarFloor(c2_t_x);
                if (c2_t_x != c2_b_bk) {
                  c2_b_eml_error();
                  goto label_4;
                }
              }

             label_4:
              ;
              c2_h_y = muDoubleScalarPower(c2_b_ak, c2_b_bk);
              c2_y = c2_y + c2_h_y;
            }
          }

          c2_e_k = c2_e_k + 1.0;
          goto label_5;
        }
      }
    } else {
      if (c2_y > 0.0) {
        c2_u_x = c2_y;
        c2_i_b = rtIsInf(c2_u_x);
        if (!c2_i_b) {
          c2_d_a = c2_scale;
          c2_e_a = c2_y;
          c2_j_b = 1.0 / c2_b_p;
          c2_c_ak = c2_e_a;
          c2_c_bk = c2_j_b;
          if (c2_c_ak < 0.0) {
            c2_v_x = c2_c_bk;
            c2_w_x = c2_v_x;
            c2_w_x = muDoubleScalarFloor(c2_w_x);
            if (c2_w_x != c2_c_bk) {
              c2_b_eml_error();
              goto label_6;
            }
          }

         label_6:
          ;
          c2_k_b = muDoubleScalarPower(c2_c_ak, c2_c_bk);
          return c2_d_a * c2_k_b;
        }
      }

      return c2_y;
    }

   label_7:
    ;
    if (c2_j <= 3.0) {
      c2_b_j = c2_j;
      c2_p_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_b_j), 1, 3, 1, 0) - 1];
      c2_e_b = rtIsNaN(c2_p_x);
      if (c2_e_b) {
        return rtNaN;
      } else {
        c2_j = c2_j + 1.0;
        goto label_7;
      }
    }
  } else if (c2_p < 0.0) {
    for (c2_i263 = 0; c2_i263 < 3; c2_i263 = c2_i263 + 1) {
      c2_x_x[c2_i263] = c2_x[c2_i263];
    }

    c2_c_p = c2_p;
    c2_y = 0.0;
    c2_b_scale = rtInf;
    c2_g_k = 1.0;
   label_10:
    ;
    if (c2_g_k <= 3.0) {
      c2_h_k = c2_g_k;
      c2_y_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_h_k), 1, 3, 1, 0) - 1];
      c2_ab_x = c2_y_x;
      c2_i_y = muDoubleScalarAbs(c2_ab_x);
      c2_c_absx = c2_i_y;
      c2_bb_x = c2_c_absx;
      c2_l_b = rtIsNaN(c2_bb_x);
      if (c2_l_b) {
        return rtNaN;
      } else if (c2_c_absx == 0.0) {
        c2_y = 0.0;
        c2_d6 = c2_h_k + 1.0;
        c2_c_j = c2_d6;
      } else {
        if (c2_c_absx < c2_b_scale) {
          c2_f_a = c2_y;
          c2_g_a = c2_b_scale / c2_c_absx;
          c2_n_b = c2_c_p;
          c2_d_ak = c2_g_a;
          c2_d_bk = c2_n_b;
          if (c2_d_ak < 0.0) {
            c2_db_x = c2_d_bk;
            c2_eb_x = c2_db_x;
            c2_eb_x = muDoubleScalarFloor(c2_eb_x);
            if (c2_eb_x != c2_d_bk) {
              c2_b_eml_error();
              goto label_8;
            }
          }

         label_8:
          ;
          c2_o_b = muDoubleScalarPower(c2_d_ak, c2_d_bk);
          c2_j_y = c2_f_a * c2_o_b;
          c2_y = 1.0 + c2_j_y;
          c2_b_scale = c2_c_absx;
        } else {
          c2_fb_x = c2_c_absx;
          c2_p_b = rtIsInf(c2_fb_x);
          if (!c2_p_b) {
            c2_h_a = c2_c_absx / c2_b_scale;
            c2_q_b = c2_c_p;
            c2_e_ak = c2_h_a;
            c2_e_bk = c2_q_b;
            if (c2_e_ak < 0.0) {
              c2_gb_x = c2_e_bk;
              c2_hb_x = c2_gb_x;
              c2_hb_x = muDoubleScalarFloor(c2_hb_x);
              if (c2_hb_x != c2_e_bk) {
                c2_b_eml_error();
                goto label_9;
              }
            }

           label_9:
            ;
            c2_k_y = muDoubleScalarPower(c2_e_ak, c2_e_bk);
            c2_y = c2_y + c2_k_y;
          }
        }

        c2_g_k = c2_g_k + 1.0;
        goto label_10;
      }
    } else {
      if (c2_y > 0.0) {
        c2_ib_x = c2_y;
        c2_r_b = rtIsInf(c2_ib_x);
        if (!c2_r_b) {
          c2_i_a = c2_b_scale;
          c2_s_b = c2_mpower(c2_y, 1.0 / c2_c_p);
          return c2_i_a * c2_s_b;
        }
      }

      return c2_y;
    }

   label_11:
    ;
    if (c2_c_j <= 3.0) {
      c2_d_j = c2_c_j;
      c2_cb_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_d_j), 1, 3, 1, 0) - 1];
      c2_m_b = rtIsNaN(c2_cb_x);
      if (c2_m_b) {
        return rtNaN;
      } else {
        c2_c_j = c2_c_j + 1.0;
        goto label_11;
      }
    }
  } else if (c2_p == 0.0) {
    return rtInf;
  } else {
    return rtNaN;
  }

  return c2_y;
}

static real_T c2_c_eml_xnrm2(real_T c2_x[3])
{
  real_T c2_y;
  int32_T c2_i264;
  real_T c2_b_x[3];
  int32_T c2_i265;
  real_T c2_c_x[3];
  real_T c2_scale;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_d_x;
  real_T c2_e_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  for (c2_i264 = 0; c2_i264 < 3; c2_i264 = c2_i264 + 1) {
    c2_b_x[c2_i264] = c2_x[c2_i264];
  }

  for (c2_i265 = 0; c2_i265 < 3; c2_i265 = c2_i265 + 1) {
    c2_c_x[c2_i265] = c2_b_x[c2_i265];
  }

  c2_y = 0.0;
  c2_scale = 0.0;
  for (c2_k = 1; c2_k < 4; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
      (real_T)c2_b_k), 1, 3, 1, 0) - 1];
    if (c2_xk != 0.0) {
      c2_d_x = c2_xk;
      c2_e_x = c2_d_x;
      c2_b_y = muDoubleScalarAbs(c2_e_x);
      c2_absxk = c2_b_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }

    c2_xk = 0.0;
    if (c2_xk != 0.0) {
      c2_f_x = c2_xk;
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_absxk = c2_c_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }
  }

  return c2_scale * muDoubleScalarSqrt(c2_y);
}

static real_T c2_mpower(real_T c2_a, real_T c2_b)
{
  real_T c2_b_a;
  real_T c2_b_b;
  real_T c2_ak;
  real_T c2_bk;
  real_T c2_x;
  real_T c2_b_x;
  c2_b_a = c2_a;
  c2_b_b = c2_b;
  c2_ak = c2_b_a;
  c2_bk = c2_b_b;
  if (c2_ak < 0.0) {
    c2_x = c2_bk;
    c2_b_x = c2_x;
    c2_b_x = muDoubleScalarFloor(c2_b_x);
    if (c2_b_x != c2_bk) {
      c2_b_eml_error();
      goto label_1;
    }
  }

 label_1:
  ;
  return muDoubleScalarPower(c2_ak, c2_bk);
}

static real_T c2_d_norm(real_T c2_x[6])
{
  int32_T c2_i266;
  real_T c2_b_x[6];
  real_T c2_s[2];
  for (c2_i266 = 0; c2_i266 < 6; c2_i266 = c2_i266 + 1) {
    c2_b_x[c2_i266] = c2_x[c2_i266];
  }

  c2_b_svd(c2_b_x, c2_s);
  return c2_s[0];
}

static void c2_b_svd(real_T c2_A[6], real_T c2_Uout[2])
{
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_s[3];
  real_T c2_e[2];
  real_T c2_work[3];
  int32_T c2_q;
  int32_T c2_b_q;
  int32_T c2_a;
  int32_T c2_qp1;
  int32_T c2_b_a;
  int32_T c2_qm1;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_qq;
  int32_T c2_c_b;
  int32_T c2_nmq;
  int32_T c2_d_a;
  int32_T c2_nmqp1;
  int32_T c2_i267;
  real_T c2_b_A[6];
  real_T c2_nrm;
  real_T c2_absx;
  real_T c2_d;
  real_T c2_y;
  real_T c2_b_y;
  real_T c2_c_y;
  real_T c2_z;
  int32_T c2_i268;
  real_T c2_c_A[6];
  int32_T c2_b_qp1;
  int32_T c2_jj;
  int32_T c2_b_jj;
  int32_T c2_e_a;
  int32_T c2_f_a;
  int32_T c2_d_b;
  int32_T c2_e_b;
  int32_T c2_qjj;
  int32_T c2_i269;
  real_T c2_d_A[6];
  int32_T c2_i270;
  real_T c2_e_A[6];
  real_T c2_t;
  real_T c2_x;
  real_T c2_d_y;
  real_T c2_b_x;
  real_T c2_e_y;
  real_T c2_b_z;
  int32_T c2_i271;
  real_T c2_f_A[6];
  int32_T c2_f_b;
  int32_T c2_pmq;
  int32_T c2_i272;
  real_T c2_b_e[2];
  real_T c2_b_absx;
  real_T c2_b_d;
  real_T c2_f_y;
  real_T c2_g_y;
  real_T c2_h_y;
  real_T c2_c_z;
  int32_T c2_i273;
  real_T c2_c_e[2];
  int32_T c2_c_qp1;
  int32_T c2_ii;
  int32_T c2_b_ii;
  int32_T c2_d_qp1;
  int32_T c2_c_jj;
  int32_T c2_g_a;
  int32_T c2_h_a;
  int32_T c2_g_b;
  int32_T c2_h_b;
  int32_T c2_qp1jj;
  int32_T c2_i274;
  real_T c2_g_A[6];
  int32_T c2_i275;
  real_T c2_b_work[3];
  int32_T c2_e_qp1;
  int32_T c2_d_jj;
  real_T c2_c_x;
  real_T c2_i_y;
  real_T c2_d_x;
  real_T c2_j_y;
  int32_T c2_i_a;
  int32_T c2_j_a;
  int32_T c2_i_b;
  int32_T c2_j_b;
  int32_T c2_i276;
  real_T c2_c_work[3];
  int32_T c2_i277;
  real_T c2_h_A[6];
  int32_T c2_m;
  int32_T c2_c_q;
  real_T c2_rt;
  real_T c2_e_x;
  real_T c2_k_y;
  real_T c2_f_x;
  real_T c2_l_y;
  real_T c2_r;
  real_T c2_g_x;
  real_T c2_m_y;
  real_T c2_h_x;
  real_T c2_n_y;
  real_T c2_d_z;
  real_T c2_i_x;
  real_T c2_o_y;
  real_T c2_j_x;
  real_T c2_p_y;
  int32_T c2_k_a;
  int32_T c2_c;
  int32_T c2_l_a;
  int32_T c2_b_c;
  real_T c2_m_a;
  real_T c2_k_b;
  real_T c2_q_y;
  real_T c2_iter;
  real_T c2_snorm;
  int32_T c2_c_ii;
  int32_T c2_n_a;
  int32_T c2_o_a;
  int32_T c2_i278;
  int32_T c2_d_ii;
  int32_T c2_p_a;
  int32_T c2_c_c;
  real_T c2_test0;
  real_T c2_ztest0;
  real_T c2_l_b;
  real_T c2_r_y;
  real_T c2_m_b;
  real_T c2_s_y;
  int32_T c2_q_a;
  int32_T c2_d_c;
  real_T c2_kase;
  int32_T c2_qs;
  int32_T c2_b_m;
  int32_T c2_e_ii;
  real_T c2_test;
  int32_T c2_r_a;
  int32_T c2_e_c;
  int32_T c2_s_a;
  int32_T c2_f_c;
  real_T c2_ztest;
  real_T c2_n_b;
  real_T c2_t_y;
  int32_T c2_t_a;
  int32_T c2_u_a;
  int32_T c2_g_c;
  real_T c2_f;
  int32_T c2_v_a;
  int32_T c2_h_c;
  int32_T c2_w_a;
  int32_T c2_i279;
  int32_T c2_c_k;
  real_T c2_t1;
  real_T c2_b_t1;
  real_T c2_b_f;
  real_T c2_sn;
  real_T c2_cs;
  int32_T c2_x_a;
  int32_T c2_km1;
  real_T c2_y_a;
  real_T c2_o_b;
  real_T c2_ab_a;
  real_T c2_p_b;
  real_T c2_u_y;
  int32_T c2_bb_a;
  int32_T c2_d_q;
  int32_T c2_d_k;
  real_T c2_c_t1;
  real_T c2_c_f;
  real_T c2_cb_a;
  real_T c2_q_b;
  real_T c2_db_a;
  real_T c2_r_b;
  real_T c2_v_y;
  int32_T c2_eb_a;
  int32_T c2_mm1;
  real_T c2_d7;
  real_T c2_d8;
  real_T c2_d9;
  real_T c2_d10;
  real_T c2_d11;
  real_T c2_dv1[5];
  real_T c2_scale;
  real_T c2_k_x;
  real_T c2_w_y;
  real_T c2_l_x;
  real_T c2_x_y;
  real_T c2_sm;
  real_T c2_m_x;
  real_T c2_y_y;
  real_T c2_n_x;
  real_T c2_ab_y;
  real_T c2_smm1;
  real_T c2_o_x;
  real_T c2_bb_y;
  real_T c2_p_x;
  real_T c2_cb_y;
  real_T c2_emm1;
  real_T c2_q_x;
  real_T c2_db_y;
  real_T c2_r_x;
  real_T c2_eb_y;
  real_T c2_sqds;
  real_T c2_s_x;
  real_T c2_fb_y;
  real_T c2_t_x;
  real_T c2_gb_y;
  real_T c2_eqds;
  real_T c2_fb_a;
  real_T c2_s_b;
  real_T c2_hb_y;
  real_T c2_gb_a;
  real_T c2_t_b;
  real_T c2_ib_y;
  real_T c2_u_x;
  real_T c2_v_x;
  real_T c2_u_b;
  real_T c2_hb_a;
  real_T c2_v_b;
  real_T c2_i_c;
  real_T c2_ib_a;
  real_T c2_w_b;
  real_T c2_shift;
  real_T c2_jb_a;
  real_T c2_x_b;
  real_T c2_jb_y;
  real_T c2_w_x;
  real_T c2_kb_y;
  real_T c2_x_x;
  real_T c2_lb_y;
  real_T c2_kb_a;
  real_T c2_y_b;
  real_T c2_mb_y;
  real_T c2_lb_a;
  real_T c2_ab_b;
  real_T c2_g;
  int32_T c2_e_q;
  int32_T c2_e_k;
  int32_T c2_mb_a;
  int32_T c2_nb_a;
  int32_T c2_kp1;
  real_T c2_d_f;
  real_T c2_b_g;
  real_T c2_ob_a;
  real_T c2_bb_b;
  real_T c2_nb_y;
  real_T c2_pb_a;
  real_T c2_cb_b;
  real_T c2_ob_y;
  real_T c2_qb_a;
  real_T c2_db_b;
  real_T c2_pb_y;
  real_T c2_rb_a;
  real_T c2_eb_b;
  real_T c2_qb_y;
  real_T c2_sb_a;
  real_T c2_fb_b;
  real_T c2_tb_a;
  real_T c2_gb_b;
  real_T c2_rb_y;
  real_T c2_e_f;
  real_T c2_c_g;
  real_T c2_ub_a;
  real_T c2_hb_b;
  real_T c2_sb_y;
  real_T c2_vb_a;
  real_T c2_ib_b;
  real_T c2_tb_y;
  real_T c2_wb_a;
  real_T c2_jb_b;
  real_T c2_ub_y;
  real_T c2_xb_a;
  real_T c2_kb_b;
  real_T c2_vb_y;
  real_T c2_yb_a;
  real_T c2_lb_b;
  real_T c2_ac_a;
  real_T c2_mb_b;
  real_T c2_wb_y;
  int32_T c2_bc_a;
  int32_T c2_j_c;
  int32_T c2_cc_a;
  int32_T c2_dc_a;
  int32_T c2_ec_a;
  int32_T c2_i280;
  static int32_T c2_iv0[2] = { 0, 1 };

  for (c2_k = 1; c2_k < 7; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    if (!c2_isfinite(c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK(
           "k", (real_T)c2_b_k), 1, 6, 1, 0) - 1])) {
      c2_eml_error();
    }
  }

  c2_c_eml_zeros(c2_s);
  c2_d_eml_zeros(c2_e);
  c2_c_eml_zeros(c2_work);
  for (c2_q = 1; c2_q < 3; c2_q = c2_q + 1) {
    c2_b_q = c2_q;
    c2_a = c2_b_q;
    c2_qp1 = c2_a + 1;
    c2_b_a = c2_b_q;
    c2_qm1 = c2_b_a - 1;
    c2_c_a = c2_b_q;
    c2_b = c2_qm1;
    c2_b_b = 3 * c2_b;
    c2_qq = c2_c_a + c2_b_b;
    c2_c_b = c2_b_q;
    c2_nmq = 3 - c2_c_b;
    c2_d_a = c2_nmq;
    c2_nmqp1 = c2_d_a + 1;
    if (c2_b_q <= 2) {
      for (c2_i267 = 0; c2_i267 < 6; c2_i267 = c2_i267 + 1) {
        c2_b_A[c2_i267] = c2_A[c2_i267];
      }

      c2_nrm = c2_d_eml_xnrm2(c2_nmqp1, c2_b_A, c2_qq);
      if (c2_nrm == 0.0) {
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = 0.0;
      } else {
        c2_absx = c2_nrm;
        c2_d = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("qq",
          (real_T)c2_qq), 1, 6, 1, 0) - 1];
        if (c2_d < 0.0) {
          c2_y = -c2_absx;
        } else {
          c2_y = c2_absx;
        }

        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = c2_y;
        c2_b_y = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_c_y = c2_b_y;
        c2_z = 1.0 / c2_c_y;
        for (c2_i268 = 0; c2_i268 < 6; c2_i268 = c2_i268 + 1) {
          c2_c_A[c2_i268] = c2_A[c2_i268];
        }

        c2_c_eml_xscal(c2_nmqp1, c2_z, c2_c_A, c2_qq, c2_A);
        c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("qq", (real_T)
          c2_qq), 1, 6, 1, 0) - 1] = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK(
          "A", _SFD_INTEGER_CHECK("qq", (real_T)c2_qq), 1, 6, 1, 0) - 1] + 1.0;
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] = -c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
          "s", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1];
      }
    }

    c2_b_qp1 = c2_qp1;
    for (c2_jj = c2_b_qp1; c2_jj < 3; c2_jj = c2_jj + 1) {
      c2_b_jj = c2_jj;
      c2_e_a = c2_b_q;
      c2_f_a = c2_b_jj;
      c2_d_b = c2_f_a - 1;
      c2_e_b = 3 * c2_d_b;
      c2_qjj = c2_e_a + c2_e_b;
      if (c2_b_q <= 2) {
        if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
          for (c2_i269 = 0; c2_i269 < 6; c2_i269 = c2_i269 + 1) {
            c2_d_A[c2_i269] = c2_A[c2_i269];
          }

          for (c2_i270 = 0; c2_i270 < 6; c2_i270 = c2_i270 + 1) {
            c2_e_A[c2_i270] = c2_A[c2_i270];
          }

          c2_t = c2_b_eml_xdotc(c2_nmqp1, c2_d_A, c2_qq, c2_e_A, c2_qjj);
          c2_x = c2_t;
          c2_d_y = c2_A[(_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("q",
                           (real_T)c2_b_q), 1, 3, 1, 0) - 1) + 3 * (
            _SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 2, 2, 0) - 1)];
          c2_b_x = c2_x;
          c2_e_y = c2_d_y;
          c2_b_z = c2_b_x / c2_e_y;
          c2_t = -c2_b_z;
          for (c2_i271 = 0; c2_i271 < 6; c2_i271 = c2_i271 + 1) {
            c2_f_A[c2_i271] = c2_A[c2_i271];
          }

          c2_d_eml_xaxpy(c2_nmqp1, c2_t, c2_qq, c2_f_A, c2_qjj, c2_A);
          goto label_1;
        }
      }

     label_1:
      ;
      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("jj", (real_T)
        c2_b_jj), 1, 2, 1, 0) - 1] = c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK
        ("A", _SFD_INTEGER_CHECK("qjj", (real_T)c2_qjj), 1, 6, 1, 0) - 1];
    }

    if (c2_b_q <= 0) {
      c2_f_b = c2_b_q;
      c2_pmq = 2 - c2_f_b;
      for (c2_i272 = 0; c2_i272 < 2; c2_i272 = c2_i272 + 1) {
        c2_b_e[c2_i272] = c2_e[c2_i272];
      }

      c2_nrm = c2_e_eml_xnrm2(c2_pmq, c2_b_e, c2_qp1);
      if (c2_nrm == 0.0) {
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = 0.0;
      } else {
        c2_b_absx = c2_nrm;
        c2_b_d = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qp1",
          (real_T)c2_qp1), 1, 2, 1, 0) - 1];
        if (c2_b_d < 0.0) {
          c2_f_y = -c2_b_absx;
        } else {
          c2_f_y = c2_b_absx;
        }

        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = c2_f_y;
        c2_g_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_h_y = c2_g_y;
        c2_c_z = 1.0 / c2_h_y;
        for (c2_i273 = 0; c2_i273 < 2; c2_i273 = c2_i273 + 1) {
          c2_c_e[c2_i273] = c2_e[c2_i273];
        }

        c2_d_eml_xscal(c2_pmq, c2_c_z, c2_c_e, c2_qp1, c2_e);
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qp1", (real_T)
          c2_qp1), 1, 2, 1, 0) - 1] = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK
          ("e", _SFD_INTEGER_CHECK("qp1", (real_T)c2_qp1), 1, 2, 1, 0) - 1] +
          1.0;
      }

      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
        c2_b_q), 1, 2, 1, 0) - 1] = -c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK(
        "e", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 2, 1, 0) - 1];
      if (c2_qp1 <= 3) {
        if (c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 2, 1, 0) - 1] != 0.0) {
          c2_c_qp1 = c2_qp1;
          for (c2_ii = c2_c_qp1; c2_ii < 4; c2_ii = c2_ii + 1) {
            c2_b_ii = c2_ii;
            c2_work[_SFD_EML_ARRAY_BOUNDS_CHECK("work", _SFD_INTEGER_CHECK("ii",
              (real_T)c2_b_ii), 1, 3, 1, 0) - 1] = 0.0;
          }

          c2_d_qp1 = c2_qp1;
          for (c2_c_jj = c2_d_qp1; c2_c_jj < 3; c2_c_jj = c2_c_jj + 1) {
            c2_b_jj = c2_c_jj;
            c2_g_a = c2_qp1;
            c2_h_a = c2_b_jj;
            c2_g_b = c2_h_a - 1;
            c2_h_b = 3 * c2_g_b;
            c2_qp1jj = c2_g_a + c2_h_b;
            for (c2_i274 = 0; c2_i274 < 6; c2_i274 = c2_i274 + 1) {
              c2_g_A[c2_i274] = c2_A[c2_i274];
            }

            for (c2_i275 = 0; c2_i275 < 3; c2_i275 = c2_i275 + 1) {
              c2_b_work[c2_i275] = c2_work[c2_i275];
            }

            c2_e_eml_xaxpy(c2_nmq, c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
              _SFD_INTEGER_CHECK("jj", (real_T)c2_b_jj), 1, 2, 1, 0) - 1],
                           c2_g_A,
                           c2_qp1jj, c2_b_work, c2_qp1, c2_work);
          }

          c2_e_qp1 = c2_qp1;
          for (c2_d_jj = c2_e_qp1; c2_d_jj < 3; c2_d_jj = c2_d_jj + 1) {
            c2_b_jj = c2_d_jj;
            c2_c_x = -c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "jj", (real_T)c2_b_jj), 1, 2, 1, 0) - 1];
            c2_i_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "qp1", (real_T)c2_qp1), 1, 2, 1, 0) - 1];
            c2_d_x = c2_c_x;
            c2_j_y = c2_i_y;
            c2_t = c2_d_x / c2_j_y;
            c2_i_a = c2_qp1;
            c2_j_a = c2_b_jj;
            c2_i_b = c2_j_a - 1;
            c2_j_b = 3 * c2_i_b;
            c2_qp1jj = c2_i_a + c2_j_b;
            for (c2_i276 = 0; c2_i276 < 3; c2_i276 = c2_i276 + 1) {
              c2_c_work[c2_i276] = c2_work[c2_i276];
            }

            for (c2_i277 = 0; c2_i277 < 6; c2_i277 = c2_i277 + 1) {
              c2_h_A[c2_i277] = c2_A[c2_i277];
            }

            c2_f_eml_xaxpy(c2_nmq, c2_t, c2_c_work, c2_qp1, c2_h_A, c2_qp1jj,
                           c2_A);
          }

          goto label_2;
        }
      }

     label_2:
      ;
    }
  }

  c2_m = 2;
  c2_e[0] = c2_A[3];
  c2_e[1] = 0.0;
  for (c2_c_q = 1; c2_c_q < 3; c2_c_q = c2_c_q + 1) {
    c2_b_q = c2_c_q;
    if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 3, 1, 0) - 1] != 0.0) {
      c2_rt = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
        "q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
      c2_e_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
        (real_T)c2_b_q), 1, 3, 1, 0) - 1];
      c2_k_y = c2_rt;
      c2_f_x = c2_e_x;
      c2_l_y = c2_k_y;
      c2_r = c2_f_x / c2_l_y;
      c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
        c2_b_q), 1, 3, 1, 0) - 1] = c2_rt;
      if (c2_b_q < 2) {
        c2_g_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_m_y = c2_r;
        c2_h_x = c2_g_x;
        c2_n_y = c2_m_y;
        c2_d_z = c2_h_x / c2_n_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = c2_d_z;
      }
    }

    if (c2_b_q < 2) {
      if (c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 2, 1, 0) - 1] != 0.0) {
        c2_rt = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
        c2_i_x = c2_rt;
        c2_o_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_j_x = c2_i_x;
        c2_p_y = c2_o_y;
        c2_r = c2_j_x / c2_p_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = c2_rt;
        c2_k_a = c2_b_q;
        c2_c = c2_k_a + 1;
        c2_l_a = c2_b_q;
        c2_b_c = c2_l_a + 1;
        c2_m_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
          (real_T)c2_b_c), 1, 3, 1, 0) - 1];
        c2_k_b = c2_r;
        c2_q_y = c2_m_a * c2_k_b;
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("", (real_T)
          c2_c), 1, 3, 1, 0) - 1] = c2_q_y;
      }
    }
  }

  c2_iter = 0.0;
  c2_snorm = 0.0;
  for (c2_c_ii = 1; c2_c_ii < 3; c2_c_ii = c2_c_ii + 1) {
    c2_b_ii = c2_c_ii;
    c2_snorm = c2_max(c2_snorm, c2_max(c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
      "s", _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1,
      0) - 1]), c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
      "ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1])));
  }

 label_11:
  ;
  if ((real_T)c2_m > 0.0) {
    if (c2_iter >= 75.0) {
      c2_c_eml_error();
    } else {
      c2_n_a = c2_m;
      c2_b_q = c2_n_a - 1;
      c2_o_a = c2_m;
      c2_i278 = c2_o_a - 1;
      c2_d_ii = c2_i278;
     label_6:
      ;
      if (c2_d_ii >= 0) {
        c2_b_ii = c2_d_ii;
        c2_b_q = c2_b_ii;
        if ((real_T)c2_b_ii == 0.0) {
          goto label_3;
        } else {
          c2_p_a = c2_b_ii;
          c2_c_c = c2_p_a + 1;
          c2_test0 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]) +
            c2_abs(c2_s[
                   _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
                     (real_T)c2_c_c), 1, 3, 1, 0) - 1]);
          c2_ztest0 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]);
          c2_l_b = c2_test0;
          c2_r_y = 2.2204460492503131E-016 * c2_l_b;
          if (c2_ztest0 <= c2_r_y) {
            goto label_4;
          } else if (c2_ztest0 <= 1.0020841800044864E-292) {
            goto label_4;
          } else {
            if (c2_iter > 20.0) {
              c2_m_b = c2_snorm;
              c2_s_y = 2.2204460492503131E-016 * c2_m_b;
              if (c2_ztest0 <= c2_s_y) {
                goto label_5;
              }
            }
          }
        }
      } else {
        goto label_3;
      }

      c2_d_ii = c2_d_ii + -1;
      goto label_6;
     label_4:
      ;
     label_5:
      ;
      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("ii", (real_T)
        c2_b_ii), 1, 2, 1, 0) - 1] = 0.0;
     label_3:
      ;
      c2_q_a = c2_m;
      c2_d_c = c2_q_a - 1;
      if (c2_b_q == c2_d_c) {
        c2_kase = 4.0;
      } else {
        c2_qs = c2_m;
        c2_b_m = c2_m;
        c2_e_ii = c2_b_m;
       label_8:
        ;
        if (c2_e_ii >= c2_b_q) {
          c2_b_ii = c2_e_ii;
          c2_qs = c2_b_ii;
          if (c2_b_ii == c2_b_q) {
            goto label_7;
          } else {
            c2_test = 0.0;
            if (c2_b_ii < c2_m) {
              c2_test = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]);
            }

            c2_r_a = c2_b_q;
            c2_e_c = c2_r_a + 1;
            if (c2_b_ii > c2_e_c) {
              c2_s_a = c2_b_ii;
              c2_f_c = c2_s_a - 1;
              c2_test = c2_test + c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("", (real_T)c2_f_c), 1, 2, 1, 0) - 1]);
            }

            c2_ztest = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
              _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 3, 1, 0) - 1]);
            c2_n_b = c2_test;
            c2_t_y = 2.2204460492503131E-016 * c2_n_b;
            if (c2_ztest <= c2_t_y) {
            } else if (c2_ztest <= 1.0020841800044864E-292) {
            } else {
              c2_e_ii = c2_e_ii + -1;
              goto label_8;
            }
          }
        } else {
          goto label_7;
        }

        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("ii", (real_T)
          c2_b_ii), 1, 3, 1, 0) - 1] = 0.0;
       label_7:
        ;
        if (c2_qs == c2_b_q) {
          c2_kase = 3.0;
        } else if (c2_qs == c2_m) {
          c2_kase = 1.0;
        } else {
          c2_kase = 2.0;
          c2_b_q = c2_qs;
        }
      }

      c2_t_a = c2_b_q;
      c2_b_q = c2_t_a + 1;
      switch ((int32_T)_SFD_INTEGER_CHECK("kase", c2_kase)) {
       case 1:
        c2_u_a = c2_m;
        c2_g_c = c2_u_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("",
          (real_T)c2_g_c), 1, 2, 1, 0) - 1];
        c2_v_a = c2_m;
        c2_h_c = c2_v_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_h_c), 1, 2, 1, 0) - 1] = 0.0;
        c2_w_a = c2_m;
        c2_i279 = c2_w_a - 1;
        for (c2_c_k = c2_i279; c2_c_k >= c2_b_q; c2_c_k = c2_c_k + -1) {
          c2_b_k = c2_c_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_b_t1 = c2_t1;
          c2_b_f = c2_f;
          c2_eml_xrotg(c2_b_t1, c2_b_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_t1;
          if (c2_b_k > c2_b_q) {
            c2_x_a = c2_b_k;
            c2_km1 = c2_x_a - 1;
            c2_y_a = -c2_sn;
            c2_o_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 2, 1, 0) - 1];
            c2_f = c2_y_a * c2_o_b;
            c2_ab_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 2, 1, 0) - 1];
            c2_p_b = c2_cs;
            c2_u_y = c2_ab_a * c2_p_b;
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 2, 1, 0) - 1] = c2_u_y;
          }
        }
        break;

       case 2:
        c2_bb_a = c2_b_q;
        c2_qm1 = c2_bb_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1",
          (real_T)c2_qm1), 1, 2, 1, 0) - 1];
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1", (real_T)
          c2_qm1), 1, 2, 1, 0) - 1] = 0.0;
        c2_d_q = c2_b_q;
        for (c2_d_k = c2_d_q; c2_d_k <= c2_m; c2_d_k = c2_d_k + 1) {
          c2_b_k = c2_d_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_c_t1 = c2_t1;
          c2_c_f = c2_f;
          c2_eml_xrotg(c2_c_t1, c2_c_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_t1;
          c2_cb_a = -c2_sn;
          c2_q_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_f = c2_cb_a * c2_q_b;
          c2_db_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_r_b = c2_cs;
          c2_v_y = c2_db_a * c2_r_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_v_y;
        }
        break;

       case 3:
        c2_eb_a = c2_m;
        c2_mm1 = c2_eb_a - 1;
        c2_d7 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
          "m", (real_T)c2_m), 1, 3, 1, 0) - 1]);
        c2_d8 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
          "mm1", (real_T)c2_mm1), 1, 3, 1, 0) - 1]);
        c2_d9 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "mm1", (real_T)c2_mm1), 1, 2, 1, 0) - 1]);
        c2_d10 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK
                         ("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1]);
        c2_d11 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK
                         ("q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
        c2_dv1[0] = c2_d7;
        c2_dv1[1] = c2_d8;
        c2_dv1[2] = c2_d9;
        c2_dv1[3] = c2_d10;
        c2_dv1[4] = c2_d11;
        c2_scale = c2_b_max(c2_dv1);
        c2_k_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("m",
          (real_T)c2_m), 1, 3, 1, 0) - 1];
        c2_w_y = c2_scale;
        c2_l_x = c2_k_x;
        c2_x_y = c2_w_y;
        c2_sm = c2_l_x / c2_x_y;
        c2_m_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 3, 1, 0) - 1];
        c2_y_y = c2_scale;
        c2_n_x = c2_m_x;
        c2_ab_y = c2_y_y;
        c2_smm1 = c2_n_x / c2_ab_y;
        c2_o_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 2, 1, 0) - 1];
        c2_bb_y = c2_scale;
        c2_p_x = c2_o_x;
        c2_cb_y = c2_bb_y;
        c2_emm1 = c2_p_x / c2_cb_y;
        c2_q_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        c2_db_y = c2_scale;
        c2_r_x = c2_q_x;
        c2_eb_y = c2_db_y;
        c2_sqds = c2_r_x / c2_eb_y;
        c2_s_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_fb_y = c2_scale;
        c2_t_x = c2_s_x;
        c2_gb_y = c2_fb_y;
        c2_eqds = c2_t_x / c2_gb_y;
        c2_fb_a = c2_emm1;
        c2_s_b = c2_emm1;
        c2_hb_y = c2_fb_a * c2_s_b;
        c2_gb_a = c2_smm1 + c2_sm;
        c2_t_b = c2_smm1 - c2_sm;
        c2_ib_y = c2_gb_a * c2_t_b;
        c2_u_x = c2_ib_y + c2_hb_y;
        c2_v_x = c2_u_x;
        c2_u_b = c2_v_x / 2.0;
        c2_hb_a = c2_sm;
        c2_v_b = c2_emm1;
        c2_i_c = c2_hb_a * c2_v_b;
        c2_ib_a = c2_i_c;
        c2_w_b = c2_i_c;
        c2_i_c = c2_ib_a * c2_w_b;
        c2_shift = 0.0;
        if (c2_u_b != 0.0) {
        } else if (c2_i_c != 0.0) {
        } else {
          goto label_9;
        }

        c2_jb_a = c2_u_b;
        c2_x_b = c2_u_b;
        c2_jb_y = c2_jb_a * c2_x_b;
        c2_shift = c2_sqrt(c2_jb_y + c2_i_c);
        if (c2_u_b < 0.0) {
          c2_shift = -c2_shift;
        }

        c2_w_x = c2_i_c;
        c2_kb_y = c2_u_b + c2_shift;
        c2_x_x = c2_w_x;
        c2_lb_y = c2_kb_y;
        c2_shift = c2_x_x / c2_lb_y;
       label_9:
        ;
        c2_kb_a = c2_sqds + c2_sm;
        c2_y_b = c2_sqds - c2_sm;
        c2_mb_y = c2_kb_a * c2_y_b;
        c2_f = c2_mb_y + c2_shift;
        c2_lb_a = c2_sqds;
        c2_ab_b = c2_eqds;
        c2_g = c2_lb_a * c2_ab_b;
        c2_e_q = c2_b_q;
        for (c2_e_k = c2_e_q; c2_e_k <= c2_mm1; c2_e_k = c2_e_k + 1) {
          c2_b_k = c2_e_k;
          c2_mb_a = c2_b_k;
          c2_km1 = c2_mb_a - 1;
          c2_nb_a = c2_b_k;
          c2_kp1 = c2_nb_a + 1;
          c2_d_f = c2_f;
          c2_b_g = c2_g;
          c2_eml_xrotg(c2_d_f, c2_b_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          if (c2_b_k > c2_b_q) {
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 2, 1, 0) - 1] = c2_f;
          }

          c2_ob_a = c2_sn;
          c2_bb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_nb_y = c2_ob_a * c2_bb_b;
          c2_pb_a = c2_cs;
          c2_cb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_ob_y = c2_pb_a * c2_cb_b;
          c2_f = c2_ob_y + c2_nb_y;
          c2_qb_a = c2_sn;
          c2_db_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 3, 1, 0) - 1];
          c2_pb_y = c2_qb_a * c2_db_b;
          c2_rb_a = c2_cs;
          c2_eb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_qb_y = c2_rb_a * c2_eb_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_qb_y - c2_pb_y;
          c2_sb_a = c2_sn;
          c2_fb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_g = c2_sb_a * c2_fb_b;
          c2_tb_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_gb_b = c2_cs;
          c2_rb_y = c2_tb_a * c2_gb_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 3, 1, 0) - 1] = c2_rb_y;
          c2_e_f = c2_f;
          c2_c_g = c2_g;
          c2_eml_xrotg(c2_e_f, c2_c_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 3, 1, 0) - 1] = c2_f;
          c2_ub_a = c2_sn;
          c2_hb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_sb_y = c2_ub_a * c2_hb_b;
          c2_vb_a = c2_cs;
          c2_ib_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_tb_y = c2_vb_a * c2_ib_b;
          c2_f = c2_tb_y + c2_sb_y;
          c2_wb_a = c2_cs;
          c2_jb_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 3, 1, 0) - 1];
          c2_ub_y = c2_wb_a * c2_jb_b;
          c2_xb_a = -c2_sn;
          c2_kb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_vb_y = c2_xb_a * c2_kb_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 3, 1, 0) - 1] = c2_vb_y + c2_ub_y;
          c2_yb_a = c2_sn;
          c2_lb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_g = c2_yb_a * c2_lb_b;
          c2_ac_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_mb_b = c2_cs;
          c2_wb_y = c2_ac_a * c2_mb_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 2, 1, 0) - 1] = c2_wb_y;
        }

        c2_bc_a = c2_m;
        c2_j_c = c2_bc_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_j_c), 1, 2, 1, 0) - 1] = c2_f;
        c2_iter = c2_iter + 1.0;
        break;

       case 4:
        if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] < 0.0) {
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 3, 1, 0) - 1] = -c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
            "s", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 3, 1, 0) - 1];
        }

        c2_cc_a = c2_b_q;
        c2_qp1 = c2_cc_a + 1;
       label_10:
        ;
        if (c2_b_q < 2) {
          if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
                (real_T)c2_b_q), 1, 3, 1, 0) - 1] < c2_s[
              _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1", (real_T)
                c2_qp1), 1, 3, 1, 0) - 1]) {
            c2_rt = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 3, 1, 0) - 1] =
              c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
              "s", _SFD_INTEGER_CHECK("qp1", (real_T)c2_qp1), 1, 3, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1",
              (real_T)c2_qp1), 1, 3, 1, 0) - 1] = c2_rt;
            c2_b_q = c2_qp1;
            c2_dc_a = c2_b_q;
            c2_qp1 = c2_dc_a + 1;
            goto label_10;
          }
        }

        c2_iter = 0.0;
        c2_ec_a = c2_m;
        c2_m = c2_ec_a - 1;
        break;
      }

      goto label_11;
    }
  }

  for (c2_i280 = 0; c2_i280 < 2; c2_i280 = c2_i280 + 1) {
    c2_Uout[c2_i280] = c2_s[c2_iv0[c2_i280]];
  }
}

static void c2_c_eml_zeros(real_T c2_x[3])
{
  int32_T c2_i281;
  for (c2_i281 = 0; c2_i281 < 3; c2_i281 = c2_i281 + 1) {
    c2_x[c2_i281] = 0.0;
  }
}

static void c2_d_eml_zeros(real_T c2_x[2])
{
  int32_T c2_i282;
  for (c2_i282 = 0; c2_i282 < 2; c2_i282 = c2_i282 + 1) {
    c2_x[c2_i282] = 0.0;
  }
}

static real_T c2_d_eml_xnrm2(int32_T c2_n, real_T c2_x[6], int32_T c2_ix0)
{
  real_T c2_y;
  int32_T c2_b_n;
  int32_T c2_i283;
  real_T c2_b_x[6];
  int32_T c2_b_ix0;
  int32_T c2_c_n;
  int32_T c2_i284;
  real_T c2_c_x[6];
  int32_T c2_c_ix0;
  real_T c2_scale;
  int32_T c2_d_x;
  int32_T c2_kstart;
  int32_T c2_a;
  int32_T c2_b_a;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_kend;
  int32_T c2_b_kstart;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_e_x;
  real_T c2_f_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_g_x;
  real_T c2_h_x;
  real_T c2_c_y;
  c2_b_n = c2_n;
  for (c2_i283 = 0; c2_i283 < 6; c2_i283 = c2_i283 + 1) {
    c2_b_x[c2_i283] = c2_x[c2_i283];
  }

  c2_b_ix0 = c2_ix0;
  c2_c_n = c2_b_n;
  for (c2_i284 = 0; c2_i284 < 6; c2_i284 = c2_i284 + 1) {
    c2_c_x[c2_i284] = c2_b_x[c2_i284];
  }

  c2_c_ix0 = c2_b_ix0;
  c2_y = 0.0;
  if ((real_T)c2_c_n < 1.0) {
  } else {
    c2_scale = 0.0;
    c2_d_x = c2_c_ix0;
    c2_kstart = c2_d_x;
    c2_a = c2_kstart;
    c2_b_a = c2_c_n;
    c2_c_a = c2_b_a - 1;
    c2_b = c2_c_a;
    c2_kend = c2_a + c2_b;
    c2_b_kstart = c2_kstart;
    for (c2_k = c2_b_kstart; c2_k <= c2_kend; c2_k = c2_k + 1) {
      c2_b_k = c2_k;
      c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
        (real_T)c2_b_k), 1, 6, 1, 0) - 1];
      if (c2_xk != 0.0) {
        c2_e_x = c2_xk;
        c2_f_x = c2_e_x;
        c2_b_y = muDoubleScalarAbs(c2_f_x);
        c2_absxk = c2_b_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }

      c2_xk = 0.0;
      if (c2_xk != 0.0) {
        c2_g_x = c2_xk;
        c2_h_x = c2_g_x;
        c2_c_y = muDoubleScalarAbs(c2_h_x);
        c2_absxk = c2_c_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }
    }

    return c2_scale * muDoubleScalarSqrt(c2_y);
  }

  return c2_y;
}

static void c2_c_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[6], int32_T
  c2_ix0, real_T c2_b_x[6])
{
  int32_T c2_i285;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i286;
  real_T c2_c_x[6];
  int32_T c2_b_ix0;
  int32_T c2_i287;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i288;
  real_T c2_d_x[6];
  int32_T c2_c_ix0;
  int32_T c2_i289;
  int32_T c2_e_x;
  int32_T c2_i290;
  int32_T c2_d_a;
  int32_T c2_e_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_b_k;
  for (c2_i285 = 0; c2_i285 < 6; c2_i285 = c2_i285 + 1) {
    c2_b_x[c2_i285] = c2_x[c2_i285];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i286 = 0; c2_i286 < 6; c2_i286 = c2_i286 + 1) {
    c2_c_x[c2_i286] = c2_b_x[c2_i286];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i287 = 0; c2_i287 < 6; c2_i287 = c2_i287 + 1) {
    c2_b_x[c2_i287] = c2_c_x[c2_i287];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i288 = 0; c2_i288 < 6; c2_i288 = c2_i288 + 1) {
    c2_d_x[c2_i288] = c2_b_x[c2_i288];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i289 = 0; c2_i289 < 6; c2_i289 = c2_i289 + 1) {
    c2_b_x[c2_i289] = c2_d_x[c2_i289];
  }

  c2_e_x = c2_c_ix0;
  c2_i290 = c2_e_x;
  c2_d_a = c2_c_ix0;
  c2_e_a = c2_c_n;
  c2_b = c2_e_a - 1;
  c2_b_b = c2_b;
  c2_loop_ub = c2_d_a + c2_b_b;
  for (c2_k = c2_i290; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)
      c2_b_k), 1, 6, 1, 0) - 1] = c2_c_a * c2_b_x[
      _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 6, 1, 0) - 1];
  }
}

static real_T c2_b_eml_xdotc(int32_T c2_n, real_T c2_x[6], int32_T c2_ix0,
  real_T c2_y[6], int32_T c2_iy0)
{
  real_T c2_d;
  int32_T c2_b_n;
  int32_T c2_i291;
  real_T c2_b_x[6];
  int32_T c2_b_ix0;
  int32_T c2_i292;
  real_T c2_b_y[6];
  int32_T c2_b_iy0;
  int32_T c2_c_n;
  int32_T c2_i293;
  real_T c2_c_x[6];
  int32_T c2_c_ix0;
  int32_T c2_i294;
  real_T c2_c_y[6];
  int32_T c2_c_iy0;
  int32_T c2_d_n;
  int32_T c2_i295;
  real_T c2_d_x[6];
  int32_T c2_d_ix0;
  int32_T c2_i296;
  real_T c2_d_y[6];
  int32_T c2_d_iy0;
  int32_T c2_e_n;
  int32_T c2_i297;
  real_T c2_e_x[6];
  int32_T c2_e_ix0;
  int32_T c2_i298;
  real_T c2_e_y[6];
  int32_T c2_e_iy0;
  int32_T c2_f_x;
  int32_T c2_ix;
  int32_T c2_g_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_a;
  int32_T c2_b_a;
  c2_b_n = c2_n;
  for (c2_i291 = 0; c2_i291 < 6; c2_i291 = c2_i291 + 1) {
    c2_b_x[c2_i291] = c2_x[c2_i291];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i292 = 0; c2_i292 < 6; c2_i292 = c2_i292 + 1) {
    c2_b_y[c2_i292] = c2_y[c2_i292];
  }

  c2_b_iy0 = c2_iy0;
  c2_c_n = c2_b_n;
  for (c2_i293 = 0; c2_i293 < 6; c2_i293 = c2_i293 + 1) {
    c2_c_x[c2_i293] = c2_b_x[c2_i293];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i294 = 0; c2_i294 < 6; c2_i294 = c2_i294 + 1) {
    c2_c_y[c2_i294] = c2_b_y[c2_i294];
  }

  c2_c_iy0 = c2_b_iy0;
  c2_d_n = c2_c_n;
  for (c2_i295 = 0; c2_i295 < 6; c2_i295 = c2_i295 + 1) {
    c2_d_x[c2_i295] = c2_c_x[c2_i295];
  }

  c2_d_ix0 = c2_c_ix0;
  for (c2_i296 = 0; c2_i296 < 6; c2_i296 = c2_i296 + 1) {
    c2_d_y[c2_i296] = c2_c_y[c2_i296];
  }

  c2_d_iy0 = c2_c_iy0;
  c2_e_n = c2_d_n;
  for (c2_i297 = 0; c2_i297 < 6; c2_i297 = c2_i297 + 1) {
    c2_e_x[c2_i297] = c2_d_x[c2_i297];
  }

  c2_e_ix0 = c2_d_ix0;
  for (c2_i298 = 0; c2_i298 < 6; c2_i298 = c2_i298 + 1) {
    c2_e_y[c2_i298] = c2_d_y[c2_i298];
  }

  c2_e_iy0 = c2_d_iy0;
  c2_d = 0.0;
  if ((real_T)c2_e_n < 1.0) {
  } else {
    c2_f_x = c2_e_ix0;
    c2_ix = c2_f_x;
    c2_g_x = c2_e_iy0;
    c2_iy = c2_g_x;
    c2_loop_ub = c2_e_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_d = c2_d + c2_e_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK(
        "ix", (real_T)c2_ix), 1, 6, 1, 0) - 1] * c2_e_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 6, 1, 0) - 1];
      c2_a = c2_iy;
      c2_iy = c2_a + 1;
      c2_b_a = c2_ix;
      c2_ix = c2_b_a + 1;
    }
  }

  return c2_d;
}

static void c2_d_eml_xaxpy(int32_T c2_n, real_T c2_a, int32_T c2_ix0, real_T
  c2_y[6], int32_T c2_iy0, real_T c2_b_y[6])
{
  int32_T c2_i299;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_b_ix0;
  int32_T c2_i300;
  real_T c2_c_y[6];
  int32_T c2_b_iy0;
  int32_T c2_i301;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_c_ix0;
  int32_T c2_i302;
  real_T c2_d_y[6];
  int32_T c2_c_iy0;
  int32_T c2_i303;
  int32_T c2_x;
  int32_T c2_ix;
  int32_T c2_b_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i299 = 0; c2_i299 < 6; c2_i299 = c2_i299 + 1) {
    c2_b_y[c2_i299] = c2_y[c2_i299];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  c2_b_ix0 = c2_ix0;
  for (c2_i300 = 0; c2_i300 < 6; c2_i300 = c2_i300 + 1) {
    c2_c_y[c2_i300] = c2_b_y[c2_i300];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i301 = 0; c2_i301 < 6; c2_i301 = c2_i301 + 1) {
    c2_b_y[c2_i301] = c2_c_y[c2_i301];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  c2_c_ix0 = c2_b_ix0;
  for (c2_i302 = 0; c2_i302 < 6; c2_i302 = c2_i302 + 1) {
    c2_d_y[c2_i302] = c2_b_y[c2_i302];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i303 = 0; c2_i303 < 6; c2_i303 = c2_i303 + 1) {
    c2_b_y[c2_i303] = c2_d_y[c2_i303];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_x = c2_c_ix0;
    c2_ix = c2_x;
    c2_b_x = c2_c_iy0;
    c2_iy = c2_b_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 6, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 6, 1, 0) - 1] + c2_c_a * c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 6, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static real_T c2_e_eml_xnrm2(int32_T c2_n, real_T c2_x[2], int32_T c2_ix0)
{
  real_T c2_y;
  int32_T c2_b_n;
  int32_T c2_i304;
  real_T c2_b_x[2];
  int32_T c2_b_ix0;
  int32_T c2_c_n;
  int32_T c2_i305;
  real_T c2_c_x[2];
  int32_T c2_c_ix0;
  real_T c2_scale;
  int32_T c2_d_x;
  int32_T c2_kstart;
  int32_T c2_a;
  int32_T c2_b_a;
  int32_T c2_c_a;
  int32_T c2_b;
  int32_T c2_kend;
  int32_T c2_b_kstart;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_e_x;
  real_T c2_f_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_g_x;
  real_T c2_h_x;
  real_T c2_c_y;
  c2_b_n = c2_n;
  for (c2_i304 = 0; c2_i304 < 2; c2_i304 = c2_i304 + 1) {
    c2_b_x[c2_i304] = c2_x[c2_i304];
  }

  c2_b_ix0 = c2_ix0;
  c2_c_n = c2_b_n;
  for (c2_i305 = 0; c2_i305 < 2; c2_i305 = c2_i305 + 1) {
    c2_c_x[c2_i305] = c2_b_x[c2_i305];
  }

  c2_c_ix0 = c2_b_ix0;
  c2_y = 0.0;
  if ((real_T)c2_c_n < 1.0) {
  } else {
    c2_scale = 0.0;
    c2_d_x = c2_c_ix0;
    c2_kstart = c2_d_x;
    c2_a = c2_kstart;
    c2_b_a = c2_c_n;
    c2_c_a = c2_b_a - 1;
    c2_b = c2_c_a;
    c2_kend = c2_a + c2_b;
    c2_b_kstart = c2_kstart;
    for (c2_k = c2_b_kstart; c2_k <= c2_kend; c2_k = c2_k + 1) {
      c2_b_k = c2_k;
      c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
        (real_T)c2_b_k), 1, 2, 1, 0) - 1];
      if (c2_xk != 0.0) {
        c2_e_x = c2_xk;
        c2_f_x = c2_e_x;
        c2_b_y = muDoubleScalarAbs(c2_f_x);
        c2_absxk = c2_b_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }

      c2_xk = 0.0;
      if (c2_xk != 0.0) {
        c2_g_x = c2_xk;
        c2_h_x = c2_g_x;
        c2_c_y = muDoubleScalarAbs(c2_h_x);
        c2_absxk = c2_c_y;
        if (c2_scale < c2_absxk) {
          c2_t = c2_scale / c2_absxk;
          c2_y = 1.0 + c2_y * c2_t * c2_t;
          c2_scale = c2_absxk;
        } else {
          c2_t = c2_absxk / c2_scale;
          c2_y = c2_y + c2_t * c2_t;
        }
      }
    }

    return c2_scale * muDoubleScalarSqrt(c2_y);
  }

  return c2_y;
}

static void c2_d_eml_xscal(int32_T c2_n, real_T c2_a, real_T c2_x[2], int32_T
  c2_ix0, real_T c2_b_x[2])
{
  int32_T c2_i306;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i307;
  real_T c2_c_x[2];
  int32_T c2_b_ix0;
  int32_T c2_i308;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i309;
  real_T c2_d_x[2];
  int32_T c2_c_ix0;
  int32_T c2_i310;
  int32_T c2_e_x;
  int32_T c2_i311;
  int32_T c2_d_a;
  int32_T c2_e_a;
  int32_T c2_b;
  int32_T c2_b_b;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_b_k;
  for (c2_i306 = 0; c2_i306 < 2; c2_i306 = c2_i306 + 1) {
    c2_b_x[c2_i306] = c2_x[c2_i306];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i307 = 0; c2_i307 < 2; c2_i307 = c2_i307 + 1) {
    c2_c_x[c2_i307] = c2_b_x[c2_i307];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i308 = 0; c2_i308 < 2; c2_i308 = c2_i308 + 1) {
    c2_b_x[c2_i308] = c2_c_x[c2_i308];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i309 = 0; c2_i309 < 2; c2_i309 = c2_i309 + 1) {
    c2_d_x[c2_i309] = c2_b_x[c2_i309];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i310 = 0; c2_i310 < 2; c2_i310 = c2_i310 + 1) {
    c2_b_x[c2_i310] = c2_d_x[c2_i310];
  }

  c2_e_x = c2_c_ix0;
  c2_i311 = c2_e_x;
  c2_d_a = c2_c_ix0;
  c2_e_a = c2_c_n;
  c2_b = c2_e_a - 1;
  c2_b_b = c2_b;
  c2_loop_ub = c2_d_a + c2_b_b;
  for (c2_k = c2_i311; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)
      c2_b_k), 1, 2, 1, 0) - 1] = c2_c_a * c2_b_x[
      _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 2, 1, 0) - 1];
  }
}

static void c2_e_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[6], int32_T
  c2_ix0, real_T c2_y[3], int32_T c2_iy0, real_T c2_b_y[
  3])
{
  int32_T c2_i312;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i313;
  real_T c2_b_x[6];
  int32_T c2_b_ix0;
  int32_T c2_i314;
  real_T c2_c_y[3];
  int32_T c2_b_iy0;
  int32_T c2_i315;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i316;
  real_T c2_c_x[6];
  int32_T c2_c_ix0;
  int32_T c2_i317;
  real_T c2_d_y[3];
  int32_T c2_c_iy0;
  int32_T c2_i318;
  int32_T c2_d_x;
  int32_T c2_ix;
  int32_T c2_e_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i312 = 0; c2_i312 < 3; c2_i312 = c2_i312 + 1) {
    c2_b_y[c2_i312] = c2_y[c2_i312];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i313 = 0; c2_i313 < 6; c2_i313 = c2_i313 + 1) {
    c2_b_x[c2_i313] = c2_x[c2_i313];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i314 = 0; c2_i314 < 3; c2_i314 = c2_i314 + 1) {
    c2_c_y[c2_i314] = c2_b_y[c2_i314];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i315 = 0; c2_i315 < 3; c2_i315 = c2_i315 + 1) {
    c2_b_y[c2_i315] = c2_c_y[c2_i315];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i316 = 0; c2_i316 < 6; c2_i316 = c2_i316 + 1) {
    c2_c_x[c2_i316] = c2_b_x[c2_i316];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i317 = 0; c2_i317 < 3; c2_i317 = c2_i317 + 1) {
    c2_d_y[c2_i317] = c2_b_y[c2_i317];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i318 = 0; c2_i318 < 3; c2_i318 = c2_i318 + 1) {
    c2_b_y[c2_i318] = c2_d_y[c2_i318];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_d_x = c2_c_ix0;
    c2_ix = c2_d_x;
    c2_e_x = c2_c_iy0;
    c2_iy = c2_e_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 3, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 3, 1, 0) - 1] + c2_c_a * c2_c_x[
        _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 6, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static void c2_f_eml_xaxpy(int32_T c2_n, real_T c2_a, real_T c2_x[3], int32_T
  c2_ix0, real_T c2_y[6], int32_T c2_iy0, real_T c2_b_y[
  6])
{
  int32_T c2_i319;
  int32_T c2_b_n;
  real_T c2_b_a;
  int32_T c2_i320;
  real_T c2_b_x[3];
  int32_T c2_b_ix0;
  int32_T c2_i321;
  real_T c2_c_y[6];
  int32_T c2_b_iy0;
  int32_T c2_i322;
  int32_T c2_c_n;
  real_T c2_c_a;
  int32_T c2_i323;
  real_T c2_c_x[3];
  int32_T c2_c_ix0;
  int32_T c2_i324;
  real_T c2_d_y[6];
  int32_T c2_c_iy0;
  int32_T c2_i325;
  int32_T c2_d_x;
  int32_T c2_ix;
  int32_T c2_e_x;
  int32_T c2_iy;
  int32_T c2_loop_ub;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i319 = 0; c2_i319 < 6; c2_i319 = c2_i319 + 1) {
    c2_b_y[c2_i319] = c2_y[c2_i319];
  }

  c2_b_n = c2_n;
  c2_b_a = c2_a;
  for (c2_i320 = 0; c2_i320 < 3; c2_i320 = c2_i320 + 1) {
    c2_b_x[c2_i320] = c2_x[c2_i320];
  }

  c2_b_ix0 = c2_ix0;
  for (c2_i321 = 0; c2_i321 < 6; c2_i321 = c2_i321 + 1) {
    c2_c_y[c2_i321] = c2_b_y[c2_i321];
  }

  c2_b_iy0 = c2_iy0;
  for (c2_i322 = 0; c2_i322 < 6; c2_i322 = c2_i322 + 1) {
    c2_b_y[c2_i322] = c2_c_y[c2_i322];
  }

  c2_c_n = c2_b_n;
  c2_c_a = c2_b_a;
  for (c2_i323 = 0; c2_i323 < 3; c2_i323 = c2_i323 + 1) {
    c2_c_x[c2_i323] = c2_b_x[c2_i323];
  }

  c2_c_ix0 = c2_b_ix0;
  for (c2_i324 = 0; c2_i324 < 6; c2_i324 = c2_i324 + 1) {
    c2_d_y[c2_i324] = c2_b_y[c2_i324];
  }

  c2_c_iy0 = c2_b_iy0;
  for (c2_i325 = 0; c2_i325 < 6; c2_i325 = c2_i325 + 1) {
    c2_b_y[c2_i325] = c2_d_y[c2_i325];
  }

  if ((real_T)c2_c_n < 1.0) {
  } else if (c2_c_a == 0.0) {
  } else {
    c2_d_x = c2_c_ix0;
    c2_ix = c2_d_x;
    c2_e_x = c2_c_iy0;
    c2_iy = c2_e_x;
    c2_loop_ub = c2_c_n;
    for (c2_k = 1; c2_k <= c2_loop_ub; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 6, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 6, 1, 0) - 1] + c2_c_a * c2_c_x[
        _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 3, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }

    return;
  }
}

static real_T c2_e_norm(real_T c2_x[3])
{
  int32_T c2_i326;
  real_T c2_b_x[3];
  for (c2_i326 = 0; c2_i326 < 3; c2_i326 = c2_i326 + 1) {
    c2_b_x[c2_i326] = c2_x[c2_i326];
  }

  return c2_b_genpnorm(c2_b_x, 2.0);
}

static real_T c2_b_genpnorm(real_T c2_x[3], real_T c2_p)
{
  real_T c2_y;
  int32_T c2_i327;
  real_T c2_b_x[3];
  real_T c2_k;
  real_T c2_b_k;
  real_T c2_c_x;
  real_T c2_d_x;
  real_T c2_b_y;
  real_T c2_absx;
  real_T c2_e_x;
  boolean_T c2_b;
  real_T c2_c_k;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  real_T c2_d_y;
  real_T c2_d_k;
  real_T c2_h_x;
  real_T c2_i_x;
  real_T c2_e_y;
  real_T c2_j_x;
  boolean_T c2_b_b;
  int32_T c2_i328;
  real_T c2_k_x[3];
  real_T c2_b_p;
  real_T c2_scale;
  real_T c2_e_k;
  real_T c2_f_k;
  real_T c2_l_x;
  real_T c2_m_x;
  real_T c2_f_y;
  real_T c2_b_absx;
  real_T c2_n_x;
  boolean_T c2_c_b;
  real_T c2_o_x;
  boolean_T c2_d_b;
  real_T c2_d12;
  real_T c2_j;
  real_T c2_b_j;
  real_T c2_p_x;
  boolean_T c2_e_b;
  real_T c2_a;
  real_T c2_b_a;
  real_T c2_f_b;
  real_T c2_ak;
  real_T c2_bk;
  real_T c2_q_x;
  real_T c2_r_x;
  real_T c2_g_b;
  real_T c2_g_y;
  real_T c2_c_a;
  real_T c2_h_b;
  real_T c2_b_ak;
  real_T c2_b_bk;
  real_T c2_s_x;
  real_T c2_t_x;
  real_T c2_h_y;
  real_T c2_u_x;
  boolean_T c2_i_b;
  real_T c2_d_a;
  real_T c2_e_a;
  real_T c2_j_b;
  real_T c2_c_ak;
  real_T c2_c_bk;
  real_T c2_v_x;
  real_T c2_w_x;
  real_T c2_k_b;
  int32_T c2_i329;
  real_T c2_x_x[3];
  real_T c2_c_p;
  real_T c2_b_scale;
  real_T c2_g_k;
  real_T c2_h_k;
  real_T c2_y_x;
  real_T c2_ab_x;
  real_T c2_i_y;
  real_T c2_c_absx;
  real_T c2_bb_x;
  boolean_T c2_l_b;
  real_T c2_d13;
  real_T c2_c_j;
  real_T c2_d_j;
  real_T c2_cb_x;
  boolean_T c2_m_b;
  real_T c2_f_a;
  real_T c2_g_a;
  real_T c2_n_b;
  real_T c2_d_ak;
  real_T c2_d_bk;
  real_T c2_db_x;
  real_T c2_eb_x;
  real_T c2_o_b;
  real_T c2_j_y;
  real_T c2_fb_x;
  boolean_T c2_p_b;
  real_T c2_h_a;
  real_T c2_q_b;
  real_T c2_e_ak;
  real_T c2_e_bk;
  real_T c2_gb_x;
  real_T c2_hb_x;
  real_T c2_k_y;
  real_T c2_ib_x;
  boolean_T c2_r_b;
  real_T c2_i_a;
  real_T c2_s_b;
  if (c2_p == 2.0) {
    for (c2_i327 = 0; c2_i327 < 3; c2_i327 = c2_i327 + 1) {
      c2_b_x[c2_i327] = c2_x[c2_i327];
    }

    return c2_f_eml_xnrm2(c2_b_x);
  } else if (c2_p == rtInf) {
    c2_y = 0.0;
    c2_k = 1.0;
   label_1:
    ;
    if (c2_k <= 3.0) {
      c2_b_k = c2_k;
      c2_c_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_d_x = c2_c_x;
      c2_b_y = muDoubleScalarAbs(c2_d_x);
      c2_absx = c2_b_y;
      c2_e_x = c2_absx;
      c2_b = rtIsNaN(c2_e_x);
      if (c2_b) {
        return rtNaN;
      } else {
        if (c2_absx > c2_y) {
          c2_y = c2_absx;
        }

        c2_k = c2_k + 1.0;
        goto label_1;
      }
    }
  } else if (c2_p == 1.0) {
    c2_y = 0.0;
    for (c2_c_k = 1.0; c2_c_k <= 3.0; c2_c_k = c2_c_k + 1.0) {
      c2_b_k = c2_c_k;
      c2_f_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_d_y = c2_c_y;
      c2_y = c2_y + c2_d_y;
    }
  } else if (c2_p == rtMinusInf) {
    c2_y = rtInf;
    c2_d_k = 1.0;
   label_2:
    ;
    if (c2_d_k <= 3.0) {
      c2_b_k = c2_d_k;
      c2_h_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 3, 1, 0) - 1];
      c2_i_x = c2_h_x;
      c2_e_y = muDoubleScalarAbs(c2_i_x);
      c2_absx = c2_e_y;
      c2_j_x = c2_absx;
      c2_b_b = rtIsNaN(c2_j_x);
      if (c2_b_b) {
        return rtNaN;
      } else {
        if (c2_absx < c2_y) {
          c2_y = c2_absx;
        }

        c2_d_k = c2_d_k + 1.0;
        goto label_2;
      }
    }
  } else if (c2_p > 0.0) {
    for (c2_i328 = 0; c2_i328 < 3; c2_i328 = c2_i328 + 1) {
      c2_k_x[c2_i328] = c2_x[c2_i328];
    }

    c2_b_p = c2_p;
    c2_y = 0.0;
    c2_scale = 0.0;
    c2_e_k = 1.0;
   label_5:
    ;
    if (c2_e_k <= 3.0) {
      c2_f_k = c2_e_k;
      c2_l_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_f_k), 1, 3, 1, 0) - 1];
      c2_m_x = c2_l_x;
      c2_f_y = muDoubleScalarAbs(c2_m_x);
      c2_b_absx = c2_f_y;
      c2_n_x = c2_b_absx;
      c2_c_b = rtIsNaN(c2_n_x);
      if (c2_c_b) {
        return rtNaN;
      } else {
        c2_o_x = c2_b_absx;
        c2_d_b = rtIsInf(c2_o_x);
        if (c2_d_b) {
          c2_y = rtInf;
          c2_d12 = c2_f_k + 1.0;
          c2_j = c2_d12;
        } else {
          if (c2_b_absx > 0.0) {
            if (c2_scale < c2_b_absx) {
              c2_a = c2_y;
              c2_b_a = c2_scale / c2_b_absx;
              c2_f_b = c2_b_p;
              c2_ak = c2_b_a;
              c2_bk = c2_f_b;
              if (c2_ak < 0.0) {
                c2_q_x = c2_bk;
                c2_r_x = c2_q_x;
                c2_r_x = muDoubleScalarFloor(c2_r_x);
                if (c2_r_x != c2_bk) {
                  c2_b_eml_error();
                  goto label_3;
                }
              }

             label_3:
              ;
              c2_g_b = muDoubleScalarPower(c2_ak, c2_bk);
              c2_g_y = c2_a * c2_g_b;
              c2_y = 1.0 + c2_g_y;
              c2_scale = c2_b_absx;
            } else {
              c2_c_a = c2_b_absx / c2_scale;
              c2_h_b = c2_b_p;
              c2_b_ak = c2_c_a;
              c2_b_bk = c2_h_b;
              if (c2_b_ak < 0.0) {
                c2_s_x = c2_b_bk;
                c2_t_x = c2_s_x;
                c2_t_x = muDoubleScalarFloor(c2_t_x);
                if (c2_t_x != c2_b_bk) {
                  c2_b_eml_error();
                  goto label_4;
                }
              }

             label_4:
              ;
              c2_h_y = muDoubleScalarPower(c2_b_ak, c2_b_bk);
              c2_y = c2_y + c2_h_y;
            }
          }

          c2_e_k = c2_e_k + 1.0;
          goto label_5;
        }
      }
    } else {
      if (c2_y > 0.0) {
        c2_u_x = c2_y;
        c2_i_b = rtIsInf(c2_u_x);
        if (!c2_i_b) {
          c2_d_a = c2_scale;
          c2_e_a = c2_y;
          c2_j_b = 1.0 / c2_b_p;
          c2_c_ak = c2_e_a;
          c2_c_bk = c2_j_b;
          if (c2_c_ak < 0.0) {
            c2_v_x = c2_c_bk;
            c2_w_x = c2_v_x;
            c2_w_x = muDoubleScalarFloor(c2_w_x);
            if (c2_w_x != c2_c_bk) {
              c2_b_eml_error();
              goto label_6;
            }
          }

         label_6:
          ;
          c2_k_b = muDoubleScalarPower(c2_c_ak, c2_c_bk);
          return c2_d_a * c2_k_b;
        }
      }

      return c2_y;
    }

   label_7:
    ;
    if (c2_j <= 3.0) {
      c2_b_j = c2_j;
      c2_p_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_b_j), 1, 3, 1, 0) - 1];
      c2_e_b = rtIsNaN(c2_p_x);
      if (c2_e_b) {
        return rtNaN;
      } else {
        c2_j = c2_j + 1.0;
        goto label_7;
      }
    }
  } else if (c2_p < 0.0) {
    for (c2_i329 = 0; c2_i329 < 3; c2_i329 = c2_i329 + 1) {
      c2_x_x[c2_i329] = c2_x[c2_i329];
    }

    c2_c_p = c2_p;
    c2_y = 0.0;
    c2_b_scale = rtInf;
    c2_g_k = 1.0;
   label_10:
    ;
    if (c2_g_k <= 3.0) {
      c2_h_k = c2_g_k;
      c2_y_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_h_k), 1, 3, 1, 0) - 1];
      c2_ab_x = c2_y_x;
      c2_i_y = muDoubleScalarAbs(c2_ab_x);
      c2_c_absx = c2_i_y;
      c2_bb_x = c2_c_absx;
      c2_l_b = rtIsNaN(c2_bb_x);
      if (c2_l_b) {
        return rtNaN;
      } else if (c2_c_absx == 0.0) {
        c2_y = 0.0;
        c2_d13 = c2_h_k + 1.0;
        c2_c_j = c2_d13;
      } else {
        if (c2_c_absx < c2_b_scale) {
          c2_f_a = c2_y;
          c2_g_a = c2_b_scale / c2_c_absx;
          c2_n_b = c2_c_p;
          c2_d_ak = c2_g_a;
          c2_d_bk = c2_n_b;
          if (c2_d_ak < 0.0) {
            c2_db_x = c2_d_bk;
            c2_eb_x = c2_db_x;
            c2_eb_x = muDoubleScalarFloor(c2_eb_x);
            if (c2_eb_x != c2_d_bk) {
              c2_b_eml_error();
              goto label_8;
            }
          }

         label_8:
          ;
          c2_o_b = muDoubleScalarPower(c2_d_ak, c2_d_bk);
          c2_j_y = c2_f_a * c2_o_b;
          c2_y = 1.0 + c2_j_y;
          c2_b_scale = c2_c_absx;
        } else {
          c2_fb_x = c2_c_absx;
          c2_p_b = rtIsInf(c2_fb_x);
          if (!c2_p_b) {
            c2_h_a = c2_c_absx / c2_b_scale;
            c2_q_b = c2_c_p;
            c2_e_ak = c2_h_a;
            c2_e_bk = c2_q_b;
            if (c2_e_ak < 0.0) {
              c2_gb_x = c2_e_bk;
              c2_hb_x = c2_gb_x;
              c2_hb_x = muDoubleScalarFloor(c2_hb_x);
              if (c2_hb_x != c2_e_bk) {
                c2_b_eml_error();
                goto label_9;
              }
            }

           label_9:
            ;
            c2_k_y = muDoubleScalarPower(c2_e_ak, c2_e_bk);
            c2_y = c2_y + c2_k_y;
          }
        }

        c2_g_k = c2_g_k + 1.0;
        goto label_10;
      }
    } else {
      if (c2_y > 0.0) {
        c2_ib_x = c2_y;
        c2_r_b = rtIsInf(c2_ib_x);
        if (!c2_r_b) {
          c2_i_a = c2_b_scale;
          c2_s_b = c2_mpower(c2_y, 1.0 / c2_c_p);
          return c2_i_a * c2_s_b;
        }
      }

      return c2_y;
    }

   label_11:
    ;
    if (c2_c_j <= 3.0) {
      c2_d_j = c2_c_j;
      c2_cb_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_d_j), 1, 3, 1, 0) - 1];
      c2_m_b = rtIsNaN(c2_cb_x);
      if (c2_m_b) {
        return rtNaN;
      } else {
        c2_c_j = c2_c_j + 1.0;
        goto label_11;
      }
    }
  } else if (c2_p == 0.0) {
    return rtInf;
  } else {
    return rtNaN;
  }

  return c2_y;
}

static real_T c2_f_eml_xnrm2(real_T c2_x[3])
{
  real_T c2_y;
  int32_T c2_i330;
  real_T c2_b_x[3];
  int32_T c2_i331;
  real_T c2_c_x[3];
  real_T c2_scale;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_d_x;
  real_T c2_e_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  for (c2_i330 = 0; c2_i330 < 3; c2_i330 = c2_i330 + 1) {
    c2_b_x[c2_i330] = c2_x[c2_i330];
  }

  for (c2_i331 = 0; c2_i331 < 3; c2_i331 = c2_i331 + 1) {
    c2_c_x[c2_i331] = c2_b_x[c2_i331];
  }

  c2_y = 0.0;
  c2_scale = 0.0;
  for (c2_k = 1; c2_k < 4; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
      (real_T)c2_b_k), 1, 3, 1, 0) - 1];
    if (c2_xk != 0.0) {
      c2_d_x = c2_xk;
      c2_e_x = c2_d_x;
      c2_b_y = muDoubleScalarAbs(c2_e_x);
      c2_absxk = c2_b_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }

    c2_xk = 0.0;
    if (c2_xk != 0.0) {
      c2_f_x = c2_xk;
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_absxk = c2_c_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }
  }

  return c2_scale * muDoubleScalarSqrt(c2_y);
}

static real_T c2_f_norm(real_T c2_x[2])
{
  int32_T c2_i332;
  real_T c2_b_x[2];
  for (c2_i332 = 0; c2_i332 < 2; c2_i332 = c2_i332 + 1) {
    c2_b_x[c2_i332] = c2_x[c2_i332];
  }

  return c2_c_genpnorm(c2_b_x, 2.0);
}

static real_T c2_c_genpnorm(real_T c2_x[2], real_T c2_p)
{
  real_T c2_y;
  int32_T c2_i333;
  real_T c2_b_x[2];
  real_T c2_k;
  real_T c2_b_k;
  real_T c2_c_x;
  real_T c2_d_x;
  real_T c2_b_y;
  real_T c2_absx;
  real_T c2_e_x;
  boolean_T c2_b;
  real_T c2_c_k;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  real_T c2_d_y;
  real_T c2_d_k;
  real_T c2_h_x;
  real_T c2_i_x;
  real_T c2_e_y;
  real_T c2_j_x;
  boolean_T c2_b_b;
  int32_T c2_i334;
  real_T c2_k_x[2];
  real_T c2_b_p;
  real_T c2_scale;
  real_T c2_e_k;
  real_T c2_f_k;
  real_T c2_l_x;
  real_T c2_m_x;
  real_T c2_f_y;
  real_T c2_b_absx;
  real_T c2_n_x;
  boolean_T c2_c_b;
  real_T c2_o_x;
  boolean_T c2_d_b;
  real_T c2_d14;
  real_T c2_j;
  real_T c2_b_j;
  real_T c2_p_x;
  boolean_T c2_e_b;
  real_T c2_a;
  real_T c2_b_a;
  real_T c2_f_b;
  real_T c2_ak;
  real_T c2_bk;
  real_T c2_q_x;
  real_T c2_r_x;
  real_T c2_g_b;
  real_T c2_g_y;
  real_T c2_c_a;
  real_T c2_h_b;
  real_T c2_b_ak;
  real_T c2_b_bk;
  real_T c2_s_x;
  real_T c2_t_x;
  real_T c2_h_y;
  real_T c2_u_x;
  boolean_T c2_i_b;
  real_T c2_d_a;
  real_T c2_e_a;
  real_T c2_j_b;
  real_T c2_c_ak;
  real_T c2_c_bk;
  real_T c2_v_x;
  real_T c2_w_x;
  real_T c2_k_b;
  int32_T c2_i335;
  real_T c2_x_x[2];
  real_T c2_c_p;
  real_T c2_b_scale;
  real_T c2_g_k;
  real_T c2_h_k;
  real_T c2_y_x;
  real_T c2_ab_x;
  real_T c2_i_y;
  real_T c2_c_absx;
  real_T c2_bb_x;
  boolean_T c2_l_b;
  real_T c2_d15;
  real_T c2_c_j;
  real_T c2_d_j;
  real_T c2_cb_x;
  boolean_T c2_m_b;
  real_T c2_f_a;
  real_T c2_g_a;
  real_T c2_n_b;
  real_T c2_d_ak;
  real_T c2_d_bk;
  real_T c2_db_x;
  real_T c2_eb_x;
  real_T c2_o_b;
  real_T c2_j_y;
  real_T c2_fb_x;
  boolean_T c2_p_b;
  real_T c2_h_a;
  real_T c2_q_b;
  real_T c2_e_ak;
  real_T c2_e_bk;
  real_T c2_gb_x;
  real_T c2_hb_x;
  real_T c2_k_y;
  real_T c2_ib_x;
  boolean_T c2_r_b;
  real_T c2_i_a;
  real_T c2_s_b;
  if (c2_p == 2.0) {
    for (c2_i333 = 0; c2_i333 < 2; c2_i333 = c2_i333 + 1) {
      c2_b_x[c2_i333] = c2_x[c2_i333];
    }

    return c2_g_eml_xnrm2(c2_b_x);
  } else if (c2_p == rtInf) {
    c2_y = 0.0;
    c2_k = 1.0;
   label_1:
    ;
    if (c2_k <= 2.0) {
      c2_b_k = c2_k;
      c2_c_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 2, 1, 0) - 1];
      c2_d_x = c2_c_x;
      c2_b_y = muDoubleScalarAbs(c2_d_x);
      c2_absx = c2_b_y;
      c2_e_x = c2_absx;
      c2_b = rtIsNaN(c2_e_x);
      if (c2_b) {
        return rtNaN;
      } else {
        if (c2_absx > c2_y) {
          c2_y = c2_absx;
        }

        c2_k = c2_k + 1.0;
        goto label_1;
      }
    }
  } else if (c2_p == 1.0) {
    c2_y = 0.0;
    for (c2_c_k = 1.0; c2_c_k <= 2.0; c2_c_k = c2_c_k + 1.0) {
      c2_b_k = c2_c_k;
      c2_f_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 2, 1, 0) - 1];
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_d_y = c2_c_y;
      c2_y = c2_y + c2_d_y;
    }
  } else if (c2_p == rtMinusInf) {
    c2_y = rtInf;
    c2_d_k = 1.0;
   label_2:
    ;
    if (c2_d_k <= 2.0) {
      c2_b_k = c2_d_k;
      c2_h_x = c2_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)_SFD_INTEGER_CHECK
        ("k", c2_b_k), 1, 2, 1, 0) - 1];
      c2_i_x = c2_h_x;
      c2_e_y = muDoubleScalarAbs(c2_i_x);
      c2_absx = c2_e_y;
      c2_j_x = c2_absx;
      c2_b_b = rtIsNaN(c2_j_x);
      if (c2_b_b) {
        return rtNaN;
      } else {
        if (c2_absx < c2_y) {
          c2_y = c2_absx;
        }

        c2_d_k = c2_d_k + 1.0;
        goto label_2;
      }
    }
  } else if (c2_p > 0.0) {
    for (c2_i334 = 0; c2_i334 < 2; c2_i334 = c2_i334 + 1) {
      c2_k_x[c2_i334] = c2_x[c2_i334];
    }

    c2_b_p = c2_p;
    c2_y = 0.0;
    c2_scale = 0.0;
    c2_e_k = 1.0;
   label_5:
    ;
    if (c2_e_k <= 2.0) {
      c2_f_k = c2_e_k;
      c2_l_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_f_k), 1, 2, 1, 0) - 1];
      c2_m_x = c2_l_x;
      c2_f_y = muDoubleScalarAbs(c2_m_x);
      c2_b_absx = c2_f_y;
      c2_n_x = c2_b_absx;
      c2_c_b = rtIsNaN(c2_n_x);
      if (c2_c_b) {
        return rtNaN;
      } else {
        c2_o_x = c2_b_absx;
        c2_d_b = rtIsInf(c2_o_x);
        if (c2_d_b) {
          c2_y = rtInf;
          c2_d14 = c2_f_k + 1.0;
          c2_j = c2_d14;
        } else {
          if (c2_b_absx > 0.0) {
            if (c2_scale < c2_b_absx) {
              c2_a = c2_y;
              c2_b_a = c2_scale / c2_b_absx;
              c2_f_b = c2_b_p;
              c2_ak = c2_b_a;
              c2_bk = c2_f_b;
              if (c2_ak < 0.0) {
                c2_q_x = c2_bk;
                c2_r_x = c2_q_x;
                c2_r_x = muDoubleScalarFloor(c2_r_x);
                if (c2_r_x != c2_bk) {
                  c2_b_eml_error();
                  goto label_3;
                }
              }

             label_3:
              ;
              c2_g_b = muDoubleScalarPower(c2_ak, c2_bk);
              c2_g_y = c2_a * c2_g_b;
              c2_y = 1.0 + c2_g_y;
              c2_scale = c2_b_absx;
            } else {
              c2_c_a = c2_b_absx / c2_scale;
              c2_h_b = c2_b_p;
              c2_b_ak = c2_c_a;
              c2_b_bk = c2_h_b;
              if (c2_b_ak < 0.0) {
                c2_s_x = c2_b_bk;
                c2_t_x = c2_s_x;
                c2_t_x = muDoubleScalarFloor(c2_t_x);
                if (c2_t_x != c2_b_bk) {
                  c2_b_eml_error();
                  goto label_4;
                }
              }

             label_4:
              ;
              c2_h_y = muDoubleScalarPower(c2_b_ak, c2_b_bk);
              c2_y = c2_y + c2_h_y;
            }
          }

          c2_e_k = c2_e_k + 1.0;
          goto label_5;
        }
      }
    } else {
      if (c2_y > 0.0) {
        c2_u_x = c2_y;
        c2_i_b = rtIsInf(c2_u_x);
        if (!c2_i_b) {
          c2_d_a = c2_scale;
          c2_e_a = c2_y;
          c2_j_b = 1.0 / c2_b_p;
          c2_c_ak = c2_e_a;
          c2_c_bk = c2_j_b;
          if (c2_c_ak < 0.0) {
            c2_v_x = c2_c_bk;
            c2_w_x = c2_v_x;
            c2_w_x = muDoubleScalarFloor(c2_w_x);
            if (c2_w_x != c2_c_bk) {
              c2_b_eml_error();
              goto label_6;
            }
          }

         label_6:
          ;
          c2_k_b = muDoubleScalarPower(c2_c_ak, c2_c_bk);
          return c2_d_a * c2_k_b;
        }
      }

      return c2_y;
    }

   label_7:
    ;
    if (c2_j <= 2.0) {
      c2_b_j = c2_j;
      c2_p_x = c2_k_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_b_j), 1, 2, 1, 0) - 1];
      c2_e_b = rtIsNaN(c2_p_x);
      if (c2_e_b) {
        return rtNaN;
      } else {
        c2_j = c2_j + 1.0;
        goto label_7;
      }
    }
  } else if (c2_p < 0.0) {
    for (c2_i335 = 0; c2_i335 < 2; c2_i335 = c2_i335 + 1) {
      c2_x_x[c2_i335] = c2_x[c2_i335];
    }

    c2_c_p = c2_p;
    c2_y = 0.0;
    c2_b_scale = rtInf;
    c2_g_k = 1.0;
   label_10:
    ;
    if (c2_g_k <= 2.0) {
      c2_h_k = c2_g_k;
      c2_y_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("k", c2_h_k), 1, 2, 1, 0) - 1];
      c2_ab_x = c2_y_x;
      c2_i_y = muDoubleScalarAbs(c2_ab_x);
      c2_c_absx = c2_i_y;
      c2_bb_x = c2_c_absx;
      c2_l_b = rtIsNaN(c2_bb_x);
      if (c2_l_b) {
        return rtNaN;
      } else if (c2_c_absx == 0.0) {
        c2_y = 0.0;
        c2_d15 = c2_h_k + 1.0;
        c2_c_j = c2_d15;
      } else {
        if (c2_c_absx < c2_b_scale) {
          c2_f_a = c2_y;
          c2_g_a = c2_b_scale / c2_c_absx;
          c2_n_b = c2_c_p;
          c2_d_ak = c2_g_a;
          c2_d_bk = c2_n_b;
          if (c2_d_ak < 0.0) {
            c2_db_x = c2_d_bk;
            c2_eb_x = c2_db_x;
            c2_eb_x = muDoubleScalarFloor(c2_eb_x);
            if (c2_eb_x != c2_d_bk) {
              c2_b_eml_error();
              goto label_8;
            }
          }

         label_8:
          ;
          c2_o_b = muDoubleScalarPower(c2_d_ak, c2_d_bk);
          c2_j_y = c2_f_a * c2_o_b;
          c2_y = 1.0 + c2_j_y;
          c2_b_scale = c2_c_absx;
        } else {
          c2_fb_x = c2_c_absx;
          c2_p_b = rtIsInf(c2_fb_x);
          if (!c2_p_b) {
            c2_h_a = c2_c_absx / c2_b_scale;
            c2_q_b = c2_c_p;
            c2_e_ak = c2_h_a;
            c2_e_bk = c2_q_b;
            if (c2_e_ak < 0.0) {
              c2_gb_x = c2_e_bk;
              c2_hb_x = c2_gb_x;
              c2_hb_x = muDoubleScalarFloor(c2_hb_x);
              if (c2_hb_x != c2_e_bk) {
                c2_b_eml_error();
                goto label_9;
              }
            }

           label_9:
            ;
            c2_k_y = muDoubleScalarPower(c2_e_ak, c2_e_bk);
            c2_y = c2_y + c2_k_y;
          }
        }

        c2_g_k = c2_g_k + 1.0;
        goto label_10;
      }
    } else {
      if (c2_y > 0.0) {
        c2_ib_x = c2_y;
        c2_r_b = rtIsInf(c2_ib_x);
        if (!c2_r_b) {
          c2_i_a = c2_b_scale;
          c2_s_b = c2_mpower(c2_y, 1.0 / c2_c_p);
          return c2_i_a * c2_s_b;
        }
      }

      return c2_y;
    }

   label_11:
    ;
    if (c2_c_j <= 2.0) {
      c2_d_j = c2_c_j;
      c2_cb_x = c2_x_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", (int32_T)
        _SFD_INTEGER_CHECK("j", c2_d_j), 1, 2, 1, 0) - 1];
      c2_m_b = rtIsNaN(c2_cb_x);
      if (c2_m_b) {
        return rtNaN;
      } else {
        c2_c_j = c2_c_j + 1.0;
        goto label_11;
      }
    }
  } else if (c2_p == 0.0) {
    return rtInf;
  } else {
    return rtNaN;
  }

  return c2_y;
}

static real_T c2_g_eml_xnrm2(real_T c2_x[2])
{
  real_T c2_y;
  int32_T c2_i336;
  real_T c2_b_x[2];
  int32_T c2_i337;
  real_T c2_c_x[2];
  real_T c2_scale;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_d_x;
  real_T c2_e_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  for (c2_i336 = 0; c2_i336 < 2; c2_i336 = c2_i336 + 1) {
    c2_b_x[c2_i336] = c2_x[c2_i336];
  }

  for (c2_i337 = 0; c2_i337 < 2; c2_i337 = c2_i337 + 1) {
    c2_c_x[c2_i337] = c2_b_x[c2_i337];
  }

  c2_y = 0.0;
  c2_scale = 0.0;
  for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
      (real_T)c2_b_k), 1, 2, 1, 0) - 1];
    if (c2_xk != 0.0) {
      c2_d_x = c2_xk;
      c2_e_x = c2_d_x;
      c2_b_y = muDoubleScalarAbs(c2_e_x);
      c2_absxk = c2_b_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }

    c2_xk = 0.0;
    if (c2_xk != 0.0) {
      c2_f_x = c2_xk;
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_absxk = c2_c_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }
  }

  return c2_scale * muDoubleScalarSqrt(c2_y);
}

static real_T c2_g_norm(real_T c2_x[4])
{
  int32_T c2_i338;
  real_T c2_b_x[4];
  real_T c2_s[2];
  for (c2_i338 = 0; c2_i338 < 4; c2_i338 = c2_i338 + 1) {
    c2_b_x[c2_i338] = c2_x[c2_i338];
  }

  c2_c_svd(c2_b_x, c2_s);
  return c2_s[0];
}

static void c2_c_svd(real_T c2_A[4], real_T c2_Uout[2])
{
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_s[2];
  real_T c2_e[2];
  real_T c2_work[2];
  int32_T c2_i339;
  real_T c2_b_A[4];
  real_T c2_nrm;
  real_T c2_absx;
  real_T c2_d;
  real_T c2_y;
  real_T c2_b_y;
  real_T c2_c_y;
  real_T c2_z;
  int32_T c2_i340;
  real_T c2_c_A[4];
  int32_T c2_i341;
  real_T c2_d_A[4];
  int32_T c2_i342;
  real_T c2_e_A[4];
  real_T c2_t;
  real_T c2_x;
  real_T c2_d_y;
  real_T c2_b_x;
  real_T c2_e_y;
  real_T c2_b_z;
  int32_T c2_i343;
  real_T c2_f_A[4];
  int32_T c2_m;
  int32_T c2_q;
  int32_T c2_b_q;
  real_T c2_rt;
  real_T c2_c_x;
  real_T c2_f_y;
  real_T c2_d_x;
  real_T c2_g_y;
  real_T c2_r;
  real_T c2_e_x;
  real_T c2_h_y;
  real_T c2_f_x;
  real_T c2_i_y;
  real_T c2_c_z;
  real_T c2_g_x;
  real_T c2_j_y;
  real_T c2_h_x;
  real_T c2_k_y;
  int32_T c2_a;
  int32_T c2_c;
  int32_T c2_b_a;
  int32_T c2_b_c;
  real_T c2_c_a;
  real_T c2_b;
  real_T c2_l_y;
  real_T c2_iter;
  real_T c2_snorm;
  int32_T c2_ii;
  int32_T c2_b_ii;
  int32_T c2_d_a;
  int32_T c2_e_a;
  int32_T c2_i344;
  int32_T c2_c_ii;
  int32_T c2_f_a;
  int32_T c2_c_c;
  real_T c2_test0;
  real_T c2_ztest0;
  real_T c2_b_b;
  real_T c2_m_y;
  real_T c2_c_b;
  real_T c2_n_y;
  int32_T c2_g_a;
  int32_T c2_d_c;
  real_T c2_kase;
  int32_T c2_qs;
  int32_T c2_b_m;
  int32_T c2_d_ii;
  real_T c2_test;
  int32_T c2_h_a;
  int32_T c2_e_c;
  int32_T c2_i_a;
  int32_T c2_f_c;
  real_T c2_ztest;
  real_T c2_d_b;
  real_T c2_o_y;
  int32_T c2_j_a;
  int32_T c2_k_a;
  int32_T c2_g_c;
  real_T c2_f;
  int32_T c2_l_a;
  int32_T c2_h_c;
  int32_T c2_m_a;
  int32_T c2_i345;
  int32_T c2_c_k;
  real_T c2_t1;
  real_T c2_b_t1;
  real_T c2_b_f;
  real_T c2_sn;
  real_T c2_cs;
  int32_T c2_n_a;
  int32_T c2_km1;
  real_T c2_o_a;
  real_T c2_e_b;
  real_T c2_p_a;
  real_T c2_f_b;
  real_T c2_p_y;
  int32_T c2_q_a;
  int32_T c2_qm1;
  int32_T c2_c_q;
  int32_T c2_d_k;
  real_T c2_c_t1;
  real_T c2_c_f;
  real_T c2_r_a;
  real_T c2_g_b;
  real_T c2_s_a;
  real_T c2_h_b;
  real_T c2_q_y;
  int32_T c2_t_a;
  int32_T c2_mm1;
  real_T c2_d16;
  real_T c2_d17;
  real_T c2_d18;
  real_T c2_d19;
  real_T c2_d20;
  real_T c2_dv2[5];
  real_T c2_scale;
  real_T c2_i_x;
  real_T c2_r_y;
  real_T c2_j_x;
  real_T c2_s_y;
  real_T c2_sm;
  real_T c2_k_x;
  real_T c2_t_y;
  real_T c2_l_x;
  real_T c2_u_y;
  real_T c2_smm1;
  real_T c2_m_x;
  real_T c2_v_y;
  real_T c2_n_x;
  real_T c2_w_y;
  real_T c2_emm1;
  real_T c2_o_x;
  real_T c2_x_y;
  real_T c2_p_x;
  real_T c2_y_y;
  real_T c2_sqds;
  real_T c2_q_x;
  real_T c2_ab_y;
  real_T c2_r_x;
  real_T c2_bb_y;
  real_T c2_eqds;
  real_T c2_u_a;
  real_T c2_i_b;
  real_T c2_cb_y;
  real_T c2_v_a;
  real_T c2_j_b;
  real_T c2_db_y;
  real_T c2_s_x;
  real_T c2_t_x;
  real_T c2_k_b;
  real_T c2_w_a;
  real_T c2_l_b;
  real_T c2_i_c;
  real_T c2_x_a;
  real_T c2_m_b;
  real_T c2_shift;
  real_T c2_y_a;
  real_T c2_n_b;
  real_T c2_eb_y;
  real_T c2_u_x;
  real_T c2_fb_y;
  real_T c2_v_x;
  real_T c2_gb_y;
  real_T c2_ab_a;
  real_T c2_o_b;
  real_T c2_hb_y;
  real_T c2_bb_a;
  real_T c2_p_b;
  real_T c2_g;
  int32_T c2_d_q;
  int32_T c2_e_k;
  int32_T c2_cb_a;
  int32_T c2_db_a;
  int32_T c2_kp1;
  real_T c2_d_f;
  real_T c2_b_g;
  real_T c2_eb_a;
  real_T c2_q_b;
  real_T c2_ib_y;
  real_T c2_fb_a;
  real_T c2_r_b;
  real_T c2_jb_y;
  real_T c2_gb_a;
  real_T c2_s_b;
  real_T c2_kb_y;
  real_T c2_hb_a;
  real_T c2_t_b;
  real_T c2_lb_y;
  real_T c2_ib_a;
  real_T c2_u_b;
  real_T c2_jb_a;
  real_T c2_v_b;
  real_T c2_mb_y;
  real_T c2_e_f;
  real_T c2_c_g;
  real_T c2_kb_a;
  real_T c2_w_b;
  real_T c2_nb_y;
  real_T c2_lb_a;
  real_T c2_x_b;
  real_T c2_ob_y;
  real_T c2_mb_a;
  real_T c2_y_b;
  real_T c2_pb_y;
  real_T c2_nb_a;
  real_T c2_ab_b;
  real_T c2_qb_y;
  real_T c2_ob_a;
  real_T c2_bb_b;
  real_T c2_pb_a;
  real_T c2_cb_b;
  real_T c2_rb_y;
  int32_T c2_qb_a;
  int32_T c2_j_c;
  int32_T c2_rb_a;
  int32_T c2_qp1;
  int32_T c2_sb_a;
  int32_T c2_tb_a;
  int32_T c2_i346;
  for (c2_k = 1; c2_k < 5; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    if (!c2_isfinite(c2_A[_SFD_EML_ARRAY_BOUNDS_CHECK("A", _SFD_INTEGER_CHECK(
           "k", (real_T)c2_b_k), 1, 4, 1, 0) - 1])) {
      c2_eml_error();
    }
  }

  c2_e_eml_zeros(c2_s);
  c2_f_eml_zeros(c2_e);
  c2_f_eml_zeros(c2_work);
  for (c2_i339 = 0; c2_i339 < 4; c2_i339 = c2_i339 + 1) {
    c2_b_A[c2_i339] = c2_A[c2_i339];
  }

  c2_nrm = c2_h_eml_xnrm2(c2_b_A);
  if (c2_nrm == 0.0) {
    c2_s[0] = 0.0;
  } else {
    c2_absx = c2_nrm;
    c2_d = c2_A[0];
    if (c2_d < 0.0) {
      c2_y = -c2_absx;
    } else {
      c2_y = c2_absx;
    }

    c2_s[0] = c2_y;
    c2_b_y = c2_s[0];
    c2_c_y = c2_b_y;
    c2_z = 1.0 / c2_c_y;
    for (c2_i340 = 0; c2_i340 < 4; c2_i340 = c2_i340 + 1) {
      c2_c_A[c2_i340] = c2_A[c2_i340];
    }

    c2_e_eml_xscal(c2_z, c2_c_A, c2_A);
    c2_A[0] = c2_A[0] + 1.0;
    c2_s[0] = -c2_s[0];
  }

  if (c2_s[0] != 0.0) {
    for (c2_i341 = 0; c2_i341 < 4; c2_i341 = c2_i341 + 1) {
      c2_d_A[c2_i341] = c2_A[c2_i341];
    }

    for (c2_i342 = 0; c2_i342 < 4; c2_i342 = c2_i342 + 1) {
      c2_e_A[c2_i342] = c2_A[c2_i342];
    }

    c2_t = c2_c_eml_xdotc(c2_d_A, c2_e_A);
    c2_x = c2_t;
    c2_d_y = c2_A[0];
    c2_b_x = c2_x;
    c2_e_y = c2_d_y;
    c2_b_z = c2_b_x / c2_e_y;
    c2_t = -c2_b_z;
    for (c2_i343 = 0; c2_i343 < 4; c2_i343 = c2_i343 + 1) {
      c2_f_A[c2_i343] = c2_A[c2_i343];
    }

    c2_g_eml_xaxpy(c2_t, c2_f_A, c2_A);
  }

  c2_e[1] = c2_A[2];
  c2_m = 2;
  c2_s[1] = c2_A[3];
  c2_e[0] = c2_A[2];
  c2_e[1] = 0.0;
  for (c2_q = 1; c2_q < 3; c2_q = c2_q + 1) {
    c2_b_q = c2_q;
    if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] != 0.0) {
      c2_rt = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
        "q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
      c2_c_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
        (real_T)c2_b_q), 1, 2, 1, 0) - 1];
      c2_f_y = c2_rt;
      c2_d_x = c2_c_x;
      c2_g_y = c2_f_y;
      c2_r = c2_d_x / c2_g_y;
      c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
        c2_b_q), 1, 2, 1, 0) - 1] = c2_rt;
      if (c2_b_q < 2) {
        c2_e_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_h_y = c2_r;
        c2_f_x = c2_e_x;
        c2_i_y = c2_h_y;
        c2_c_z = c2_f_x / c2_i_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = c2_c_z;
      }
    }

    if (c2_b_q < 2) {
      if (c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 2, 1, 0) - 1] != 0.0) {
        c2_rt = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
          "q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
        c2_g_x = c2_rt;
        c2_j_y = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_h_x = c2_g_x;
        c2_k_y = c2_j_y;
        c2_r = c2_h_x / c2_k_y;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q", (real_T)
          c2_b_q), 1, 2, 1, 0) - 1] = c2_rt;
        c2_a = c2_b_q;
        c2_c = c2_a + 1;
        c2_b_a = c2_b_q;
        c2_b_c = c2_b_a + 1;
        c2_c_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
          (real_T)c2_b_c), 1, 2, 1, 0) - 1];
        c2_b = c2_r;
        c2_l_y = c2_c_a * c2_b;
        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("", (real_T)
          c2_c), 1, 2, 1, 0) - 1] = c2_l_y;
      }
    }
  }

  c2_iter = 0.0;
  c2_snorm = 0.0;
  for (c2_ii = 1; c2_ii < 3; c2_ii = c2_ii + 1) {
    c2_b_ii = c2_ii;
    c2_snorm = c2_max(c2_snorm, c2_max(c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
      "s", _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1,
      0) - 1]), c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
      "ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1])));
  }

 label_9:
  ;
  if ((real_T)c2_m > 0.0) {
    if (c2_iter >= 75.0) {
      c2_c_eml_error();
    } else {
      c2_d_a = c2_m;
      c2_b_q = c2_d_a - 1;
      c2_e_a = c2_m;
      c2_i344 = c2_e_a - 1;
      c2_c_ii = c2_i344;
     label_4:
      ;
      if (c2_c_ii >= 0) {
        c2_b_ii = c2_c_ii;
        c2_b_q = c2_b_ii;
        if ((real_T)c2_b_ii == 0.0) {
          goto label_1;
        } else {
          c2_f_a = c2_b_ii;
          c2_c_c = c2_f_a + 1;
          c2_test0 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]) +
            c2_abs(c2_s[
                   _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("",
                     (real_T)c2_c_c), 1, 2, 1, 0) - 1]);
          c2_ztest0 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
            _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]);
          c2_b_b = c2_test0;
          c2_m_y = 2.2204460492503131E-016 * c2_b_b;
          if (c2_ztest0 <= c2_m_y) {
            goto label_2;
          } else if (c2_ztest0 <= 1.0020841800044864E-292) {
            goto label_2;
          } else {
            if (c2_iter > 20.0) {
              c2_c_b = c2_snorm;
              c2_n_y = 2.2204460492503131E-016 * c2_c_b;
              if (c2_ztest0 <= c2_n_y) {
                goto label_3;
              }
            }
          }
        }
      } else {
        goto label_1;
      }

      c2_c_ii = c2_c_ii + -1;
      goto label_4;
     label_2:
      ;
     label_3:
      ;
      c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("ii", (real_T)
        c2_b_ii), 1, 2, 1, 0) - 1] = 0.0;
     label_1:
      ;
      c2_g_a = c2_m;
      c2_d_c = c2_g_a - 1;
      if (c2_b_q == c2_d_c) {
        c2_kase = 4.0;
      } else {
        c2_qs = c2_m;
        c2_b_m = c2_m;
        c2_d_ii = c2_b_m;
       label_6:
        ;
        if (c2_d_ii >= c2_b_q) {
          c2_b_ii = c2_d_ii;
          c2_qs = c2_b_ii;
          if (c2_b_ii == c2_b_q) {
            goto label_5;
          } else {
            c2_test = 0.0;
            if (c2_b_ii < c2_m) {
              c2_test = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]);
            }

            c2_h_a = c2_b_q;
            c2_e_c = c2_h_a + 1;
            if (c2_b_ii > c2_e_c) {
              c2_i_a = c2_b_ii;
              c2_f_c = c2_i_a - 1;
              c2_test = c2_test + c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e",
                _SFD_INTEGER_CHECK("", (real_T)c2_f_c), 1, 2, 1, 0) - 1]);
            }

            c2_ztest = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s",
              _SFD_INTEGER_CHECK("ii", (real_T)c2_b_ii), 1, 2, 1, 0) - 1]);
            c2_d_b = c2_test;
            c2_o_y = 2.2204460492503131E-016 * c2_d_b;
            if (c2_ztest <= c2_o_y) {
            } else if (c2_ztest <= 1.0020841800044864E-292) {
            } else {
              c2_d_ii = c2_d_ii + -1;
              goto label_6;
            }
          }
        } else {
          goto label_5;
        }

        c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("ii", (real_T)
          c2_b_ii), 1, 2, 1, 0) - 1] = 0.0;
       label_5:
        ;
        if (c2_qs == c2_b_q) {
          c2_kase = 3.0;
        } else if (c2_qs == c2_m) {
          c2_kase = 1.0;
        } else {
          c2_kase = 2.0;
          c2_b_q = c2_qs;
        }
      }

      c2_j_a = c2_b_q;
      c2_b_q = c2_j_a + 1;
      switch ((int32_T)_SFD_INTEGER_CHECK("kase", c2_kase)) {
       case 1:
        c2_k_a = c2_m;
        c2_g_c = c2_k_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("",
          (real_T)c2_g_c), 1, 2, 1, 0) - 1];
        c2_l_a = c2_m;
        c2_h_c = c2_l_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_h_c), 1, 2, 1, 0) - 1] = 0.0;
        c2_m_a = c2_m;
        c2_i345 = c2_m_a - 1;
        for (c2_c_k = c2_i345; c2_c_k >= c2_b_q; c2_c_k = c2_c_k + -1) {
          c2_b_k = c2_c_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_b_t1 = c2_t1;
          c2_b_f = c2_f;
          c2_eml_xrotg(c2_b_t1, c2_b_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_t1;
          if (c2_b_k > c2_b_q) {
            c2_n_a = c2_b_k;
            c2_km1 = c2_n_a - 1;
            c2_o_a = -c2_sn;
            c2_e_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 2, 1, 0) - 1];
            c2_f = c2_o_a * c2_e_b;
            c2_p_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
              "km1", (real_T)c2_km1), 1, 2, 1, 0) - 1];
            c2_f_b = c2_cs;
            c2_p_y = c2_p_a * c2_f_b;
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 2, 1, 0) - 1] = c2_p_y;
          }
        }
        break;

       case 2:
        c2_q_a = c2_b_q;
        c2_qm1 = c2_q_a - 1;
        c2_f = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1",
          (real_T)c2_qm1), 1, 2, 1, 0) - 1];
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("qm1", (real_T)
          c2_qm1), 1, 2, 1, 0) - 1] = 0.0;
        c2_c_q = c2_b_q;
        for (c2_d_k = c2_c_q; c2_d_k <= c2_m; c2_d_k = c2_d_k + 1) {
          c2_b_k = c2_d_k;
          c2_t1 = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_c_t1 = c2_t1;
          c2_c_f = c2_f;
          c2_eml_xrotg(c2_c_t1, c2_c_f, &c2_t1, &c2_f, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_t1;
          c2_r_a = -c2_sn;
          c2_g_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_f = c2_r_a * c2_g_b;
          c2_s_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_h_b = c2_cs;
          c2_q_y = c2_s_a * c2_h_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_q_y;
        }
        break;

       case 3:
        c2_t_a = c2_m;
        c2_mm1 = c2_t_a - 1;
        c2_d16 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK
                         ("m", (real_T)c2_m), 1, 2, 1, 0) - 1]);
        c2_d17 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK
                         ("mm1", (real_T)c2_mm1), 1, 2, 1, 0) - 1]);
        c2_d18 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK
                         ("mm1", (real_T)c2_mm1), 1, 2, 1, 0) - 1]);
        c2_d19 = c2_abs(c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK
                         ("q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
        c2_d20 = c2_abs(c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK
                         ("q", (real_T)c2_b_q), 1, 2, 1, 0) - 1]);
        c2_dv2[0] = c2_d16;
        c2_dv2[1] = c2_d17;
        c2_dv2[2] = c2_d18;
        c2_dv2[3] = c2_d19;
        c2_dv2[4] = c2_d20;
        c2_scale = c2_b_max(c2_dv2);
        c2_i_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("m",
          (real_T)c2_m), 1, 2, 1, 0) - 1];
        c2_r_y = c2_scale;
        c2_j_x = c2_i_x;
        c2_s_y = c2_r_y;
        c2_sm = c2_j_x / c2_s_y;
        c2_k_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 2, 1, 0) - 1];
        c2_t_y = c2_scale;
        c2_l_x = c2_k_x;
        c2_u_y = c2_t_y;
        c2_smm1 = c2_l_x / c2_u_y;
        c2_m_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("mm1",
          (real_T)c2_mm1), 1, 2, 1, 0) - 1];
        c2_v_y = c2_scale;
        c2_n_x = c2_m_x;
        c2_w_y = c2_v_y;
        c2_emm1 = c2_n_x / c2_w_y;
        c2_o_x = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_x_y = c2_scale;
        c2_p_x = c2_o_x;
        c2_y_y = c2_x_y;
        c2_sqds = c2_p_x / c2_y_y;
        c2_q_x = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("q",
          (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        c2_ab_y = c2_scale;
        c2_r_x = c2_q_x;
        c2_bb_y = c2_ab_y;
        c2_eqds = c2_r_x / c2_bb_y;
        c2_u_a = c2_emm1;
        c2_i_b = c2_emm1;
        c2_cb_y = c2_u_a * c2_i_b;
        c2_v_a = c2_smm1 + c2_sm;
        c2_j_b = c2_smm1 - c2_sm;
        c2_db_y = c2_v_a * c2_j_b;
        c2_s_x = c2_db_y + c2_cb_y;
        c2_t_x = c2_s_x;
        c2_k_b = c2_t_x / 2.0;
        c2_w_a = c2_sm;
        c2_l_b = c2_emm1;
        c2_i_c = c2_w_a * c2_l_b;
        c2_x_a = c2_i_c;
        c2_m_b = c2_i_c;
        c2_i_c = c2_x_a * c2_m_b;
        c2_shift = 0.0;
        if (c2_k_b != 0.0) {
        } else if (c2_i_c != 0.0) {
        } else {
          goto label_7;
        }

        c2_y_a = c2_k_b;
        c2_n_b = c2_k_b;
        c2_eb_y = c2_y_a * c2_n_b;
        c2_shift = c2_sqrt(c2_eb_y + c2_i_c);
        if (c2_k_b < 0.0) {
          c2_shift = -c2_shift;
        }

        c2_u_x = c2_i_c;
        c2_fb_y = c2_k_b + c2_shift;
        c2_v_x = c2_u_x;
        c2_gb_y = c2_fb_y;
        c2_shift = c2_v_x / c2_gb_y;
       label_7:
        ;
        c2_ab_a = c2_sqds + c2_sm;
        c2_o_b = c2_sqds - c2_sm;
        c2_hb_y = c2_ab_a * c2_o_b;
        c2_f = c2_hb_y + c2_shift;
        c2_bb_a = c2_sqds;
        c2_p_b = c2_eqds;
        c2_g = c2_bb_a * c2_p_b;
        c2_d_q = c2_b_q;
        for (c2_e_k = c2_d_q; c2_e_k <= c2_mm1; c2_e_k = c2_e_k + 1) {
          c2_b_k = c2_e_k;
          c2_cb_a = c2_b_k;
          c2_km1 = c2_cb_a - 1;
          c2_db_a = c2_b_k;
          c2_kp1 = c2_db_a + 1;
          c2_d_f = c2_f;
          c2_b_g = c2_g;
          c2_eml_xrotg(c2_d_f, c2_b_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          if (c2_b_k > c2_b_q) {
            c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("km1",
              (real_T)c2_km1), 1, 2, 1, 0) - 1] = c2_f;
          }

          c2_eb_a = c2_sn;
          c2_q_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_ib_y = c2_eb_a * c2_q_b;
          c2_fb_a = c2_cs;
          c2_r_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_jb_y = c2_fb_a * c2_r_b;
          c2_f = c2_jb_y + c2_ib_y;
          c2_gb_a = c2_sn;
          c2_s_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_kb_y = c2_gb_a * c2_s_b;
          c2_hb_a = c2_cs;
          c2_t_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_lb_y = c2_hb_a * c2_t_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_lb_y - c2_kb_y;
          c2_ib_a = c2_sn;
          c2_u_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_g = c2_ib_a * c2_u_b;
          c2_jb_a = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_v_b = c2_cs;
          c2_mb_y = c2_jb_a * c2_v_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 2, 1, 0) - 1] = c2_mb_y;
          c2_e_f = c2_f;
          c2_c_g = c2_g;
          c2_eml_xrotg(c2_e_f, c2_c_g, &c2_f, &c2_g, &c2_cs, &c2_sn);
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("k", (real_T)
            c2_b_k), 1, 2, 1, 0) - 1] = c2_f;
          c2_kb_a = c2_sn;
          c2_w_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_nb_y = c2_kb_a * c2_w_b;
          c2_lb_a = c2_cs;
          c2_x_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_ob_y = c2_lb_a * c2_x_b;
          c2_f = c2_ob_y + c2_nb_y;
          c2_mb_a = c2_cs;
          c2_y_b = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_pb_y = c2_mb_a * c2_y_b;
          c2_nb_a = -c2_sn;
          c2_ab_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("k",
            (real_T)c2_b_k), 1, 2, 1, 0) - 1];
          c2_qb_y = c2_nb_a * c2_ab_b;
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 2, 1, 0) - 1] = c2_qb_y + c2_pb_y;
          c2_ob_a = c2_sn;
          c2_bb_b = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_g = c2_ob_a * c2_bb_b;
          c2_pb_a = c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK(
            "kp1", (real_T)c2_kp1), 1, 2, 1, 0) - 1];
          c2_cb_b = c2_cs;
          c2_rb_y = c2_pb_a * c2_cb_b;
          c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("kp1",
            (real_T)c2_kp1), 1, 2, 1, 0) - 1] = c2_rb_y;
        }

        c2_qb_a = c2_m;
        c2_j_c = c2_qb_a - 1;
        c2_e[_SFD_EML_ARRAY_BOUNDS_CHECK("e", _SFD_INTEGER_CHECK("", (real_T)
          c2_j_c), 1, 2, 1, 0) - 1] = c2_f;
        c2_iter = c2_iter + 1.0;
        break;

       case 4:
        if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 2, 1, 0) - 1] < 0.0) {
          c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q", (real_T)
            c2_b_q), 1, 2, 1, 0) - 1] = -c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
            "s", _SFD_INTEGER_CHECK("q", (real_T)c2_b_q), 1, 2, 1, 0) - 1];
        }

        c2_rb_a = c2_b_q;
        c2_qp1 = c2_rb_a + 1;
       label_8:
        ;
        if (c2_b_q < 2) {
          if (c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
                (real_T)c2_b_q), 1, 2, 1, 0) - 1] < c2_s[
              _SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1", (real_T)
                c2_qp1), 1, 2, 1, 0) - 1]) {
            c2_rt = c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 2, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("q",
              (real_T)c2_b_q), 1, 2, 1, 0) - 1] =
              c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK(
              "s", _SFD_INTEGER_CHECK("qp1", (real_T)c2_qp1), 1, 2, 1, 0) - 1];
            c2_s[_SFD_EML_ARRAY_BOUNDS_CHECK("s", _SFD_INTEGER_CHECK("qp1",
              (real_T)c2_qp1), 1, 2, 1, 0) - 1] = c2_rt;
            c2_b_q = c2_qp1;
            c2_sb_a = c2_b_q;
            c2_qp1 = c2_sb_a + 1;
            goto label_8;
          }
        }

        c2_iter = 0.0;
        c2_tb_a = c2_m;
        c2_m = c2_tb_a - 1;
        break;
      }

      goto label_9;
    }
  }

  for (c2_i346 = 0; c2_i346 < 2; c2_i346 = c2_i346 + 1) {
    c2_Uout[c2_i346] = c2_s[c2_i346];
  }
}

static void c2_e_eml_zeros(real_T c2_x[2])
{
  int32_T c2_i347;
  for (c2_i347 = 0; c2_i347 < 2; c2_i347 = c2_i347 + 1) {
    c2_x[c2_i347] = 0.0;
  }
}

static void c2_f_eml_zeros(real_T c2_x[2])
{
  int32_T c2_i348;
  for (c2_i348 = 0; c2_i348 < 2; c2_i348 = c2_i348 + 1) {
    c2_x[c2_i348] = 0.0;
  }
}

static real_T c2_h_eml_xnrm2(real_T c2_x[4])
{
  real_T c2_y;
  int32_T c2_i349;
  real_T c2_b_x[4];
  int32_T c2_i350;
  real_T c2_c_x[4];
  real_T c2_scale;
  int32_T c2_k;
  int32_T c2_b_k;
  real_T c2_xk;
  real_T c2_d_x;
  real_T c2_e_x;
  real_T c2_b_y;
  real_T c2_absxk;
  real_T c2_t;
  real_T c2_f_x;
  real_T c2_g_x;
  real_T c2_c_y;
  for (c2_i349 = 0; c2_i349 < 4; c2_i349 = c2_i349 + 1) {
    c2_b_x[c2_i349] = c2_x[c2_i349];
  }

  for (c2_i350 = 0; c2_i350 < 4; c2_i350 = c2_i350 + 1) {
    c2_c_x[c2_i350] = c2_b_x[c2_i350];
  }

  c2_y = 0.0;
  c2_scale = 0.0;
  for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_xk = c2_c_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k",
      (real_T)c2_b_k), 1, 4, 1, 0) - 1];
    if (c2_xk != 0.0) {
      c2_d_x = c2_xk;
      c2_e_x = c2_d_x;
      c2_b_y = muDoubleScalarAbs(c2_e_x);
      c2_absxk = c2_b_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }

    c2_xk = 0.0;
    if (c2_xk != 0.0) {
      c2_f_x = c2_xk;
      c2_g_x = c2_f_x;
      c2_c_y = muDoubleScalarAbs(c2_g_x);
      c2_absxk = c2_c_y;
      if (c2_scale < c2_absxk) {
        c2_t = c2_scale / c2_absxk;
        c2_y = 1.0 + c2_y * c2_t * c2_t;
        c2_scale = c2_absxk;
      } else {
        c2_t = c2_absxk / c2_scale;
        c2_y = c2_y + c2_t * c2_t;
      }
    }
  }

  return c2_scale * muDoubleScalarSqrt(c2_y);
}

static void c2_e_eml_xscal(real_T c2_a, real_T c2_x[4], real_T c2_b_x[4])
{
  int32_T c2_i351;
  real_T c2_b_a;
  int32_T c2_i352;
  real_T c2_c_x[4];
  int32_T c2_i353;
  real_T c2_c_a;
  int32_T c2_i354;
  real_T c2_d_x[4];
  int32_T c2_i355;
  int32_T c2_k;
  int32_T c2_b_k;
  for (c2_i351 = 0; c2_i351 < 4; c2_i351 = c2_i351 + 1) {
    c2_b_x[c2_i351] = c2_x[c2_i351];
  }

  c2_b_a = c2_a;
  for (c2_i352 = 0; c2_i352 < 4; c2_i352 = c2_i352 + 1) {
    c2_c_x[c2_i352] = c2_b_x[c2_i352];
  }

  for (c2_i353 = 0; c2_i353 < 4; c2_i353 = c2_i353 + 1) {
    c2_b_x[c2_i353] = c2_c_x[c2_i353];
  }

  c2_c_a = c2_b_a;
  for (c2_i354 = 0; c2_i354 < 4; c2_i354 = c2_i354 + 1) {
    c2_d_x[c2_i354] = c2_b_x[c2_i354];
  }

  for (c2_i355 = 0; c2_i355 < 4; c2_i355 = c2_i355 + 1) {
    c2_b_x[c2_i355] = c2_d_x[c2_i355];
  }

  for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)
      c2_b_k), 1, 4, 1, 0) - 1] = c2_c_a * c2_b_x[
      _SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 4, 1, 0) - 1];
  }
}

static real_T c2_c_eml_xdotc(real_T c2_x[4], real_T c2_y[4])
{
  real_T c2_d;
  int32_T c2_i356;
  real_T c2_b_x[4];
  int32_T c2_i357;
  real_T c2_b_y[4];
  int32_T c2_i358;
  real_T c2_c_x[4];
  int32_T c2_i359;
  real_T c2_c_y[4];
  int32_T c2_i360;
  real_T c2_d_x[4];
  int32_T c2_i361;
  real_T c2_d_y[4];
  int32_T c2_i362;
  real_T c2_e_x[4];
  int32_T c2_i363;
  real_T c2_e_y[4];
  int32_T c2_ix;
  int32_T c2_iy;
  int32_T c2_k;
  int32_T c2_a;
  int32_T c2_b_a;
  for (c2_i356 = 0; c2_i356 < 4; c2_i356 = c2_i356 + 1) {
    c2_b_x[c2_i356] = c2_x[c2_i356];
  }

  for (c2_i357 = 0; c2_i357 < 4; c2_i357 = c2_i357 + 1) {
    c2_b_y[c2_i357] = c2_y[c2_i357];
  }

  for (c2_i358 = 0; c2_i358 < 4; c2_i358 = c2_i358 + 1) {
    c2_c_x[c2_i358] = c2_b_x[c2_i358];
  }

  for (c2_i359 = 0; c2_i359 < 4; c2_i359 = c2_i359 + 1) {
    c2_c_y[c2_i359] = c2_b_y[c2_i359];
  }

  for (c2_i360 = 0; c2_i360 < 4; c2_i360 = c2_i360 + 1) {
    c2_d_x[c2_i360] = c2_c_x[c2_i360];
  }

  for (c2_i361 = 0; c2_i361 < 4; c2_i361 = c2_i361 + 1) {
    c2_d_y[c2_i361] = c2_c_y[c2_i361];
  }

  for (c2_i362 = 0; c2_i362 < 4; c2_i362 = c2_i362 + 1) {
    c2_e_x[c2_i362] = c2_d_x[c2_i362];
  }

  for (c2_i363 = 0; c2_i363 < 4; c2_i363 = c2_i363 + 1) {
    c2_e_y[c2_i363] = c2_d_y[c2_i363];
  }

  c2_d = 0.0;
  c2_ix = 1;
  c2_iy = 3;
  for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
    c2_d = c2_d + c2_e_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK(
      "ix", (real_T)c2_ix), 1, 4, 1, 0) - 1] * c2_e_y[
      _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
      1, 4, 1, 0) - 1];
    c2_a = c2_iy;
    c2_iy = c2_a + 1;
    c2_b_a = c2_ix;
    c2_ix = c2_b_a + 1;
  }

  return c2_d;
}

static void c2_g_eml_xaxpy(real_T c2_a, real_T c2_y[4], real_T c2_b_y[4])
{
  int32_T c2_i364;
  real_T c2_b_a;
  int32_T c2_i365;
  real_T c2_c_y[4];
  int32_T c2_i366;
  real_T c2_c_a;
  int32_T c2_i367;
  real_T c2_d_y[4];
  int32_T c2_i368;
  int32_T c2_ix;
  int32_T c2_iy;
  int32_T c2_k;
  int32_T c2_d_a;
  int32_T c2_e_a;
  for (c2_i364 = 0; c2_i364 < 4; c2_i364 = c2_i364 + 1) {
    c2_b_y[c2_i364] = c2_y[c2_i364];
  }

  c2_b_a = c2_a;
  for (c2_i365 = 0; c2_i365 < 4; c2_i365 = c2_i365 + 1) {
    c2_c_y[c2_i365] = c2_b_y[c2_i365];
  }

  for (c2_i366 = 0; c2_i366 < 4; c2_i366 = c2_i366 + 1) {
    c2_b_y[c2_i366] = c2_c_y[c2_i366];
  }

  c2_c_a = c2_b_a;
  for (c2_i367 = 0; c2_i367 < 4; c2_i367 = c2_i367 + 1) {
    c2_d_y[c2_i367] = c2_b_y[c2_i367];
  }

  for (c2_i368 = 0; c2_i368 < 4; c2_i368 = c2_i368 + 1) {
    c2_b_y[c2_i368] = c2_d_y[c2_i368];
  }

  if (c2_c_a == 0.0) {
  } else {
    c2_ix = 1;
    c2_iy = 3;
    for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
      c2_b_y[_SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)
        c2_iy), 1, 4, 1, 0) - 1] = c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("iy", (real_T)c2_iy),
        1, 4, 1, 0) - 1] + c2_c_a * c2_b_y[
        _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("ix", (real_T)c2_ix),
        1, 4, 1, 0) - 1];
      c2_d_a = c2_iy;
      c2_iy = c2_d_a + 1;
      c2_e_a = c2_ix;
      c2_ix = c2_e_a + 1;
    }
  }
}

static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  real_T c2_b_u;
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  c2_b_u = *((real_T *)c2_u);
  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 0U, 0U, 0));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i369;
  int32_T c2_i370;
  real_T c2_b_u[9];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i369 = 0; c2_i369 < 3; c2_i369 = c2_i369 + 1) {
    for (c2_i370 = 0; c2_i370 < 3; c2_i370 = c2_i370 + 1) {
      c2_b_u[c2_i370 + 3 * c2_i369] = (*((real_T (*)[9])c2_u))[c2_i370 + 3 *
        c2_i369];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 3, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_c_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i371;
  real_T c2_b_u[3];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i371 = 0; c2_i371 < 3; c2_i371 = c2_i371 + 1) {
    c2_b_u[c2_i371] = (*((real_T (*)[3])c2_u))[c2_i371];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 1, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_d_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i372;
  int32_T c2_i373;
  real_T c2_b_u[6];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i372 = 0; c2_i372 < 2; c2_i372 = c2_i372 + 1) {
    for (c2_i373 = 0; c2_i373 < 3; c2_i373 = c2_i373 + 1) {
      c2_b_u[c2_i373 + 3 * c2_i372] = (*((real_T (*)[6])c2_u))[c2_i373 + 3 *
        c2_i372];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 3, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_e_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i374;
  real_T c2_b_u[3];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i374 = 0; c2_i374 < 3; c2_i374 = c2_i374 + 1) {
    c2_b_u[c2_i374] = (*((real_T (*)[3])c2_u))[c2_i374];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 1, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_f_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i375;
  real_T c2_b_u[2];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i375 = 0; c2_i375 < 2; c2_i375 = c2_i375 + 1) {
    c2_b_u[c2_i375] = (*((real_T (*)[2])c2_u))[c2_i375];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 1, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_g_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i376;
  int32_T c2_i377;
  real_T c2_b_u[4];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i376 = 0; c2_i376 < 2; c2_i376 = c2_i376 + 1) {
    for (c2_i377 = 0; c2_i377 < 2; c2_i377 = c2_i377 + 1) {
      c2_b_u[c2_i377 + 2 * c2_i376] = (*((real_T (*)[4])c2_u))[c2_i377 + 2 *
        c2_i376];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 2, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

const mxArray *sf_c2_kalman2_get_eml_resolved_functions_info(void)
{
  const mxArray *c2_nameCaptureInfo = NULL;
  c2_ResolvedFunctionInfo c2_info[107];
  const mxArray *c2_m0 = NULL;
  int32_T c2_i378;
  c2_ResolvedFunctionInfo *c2_r0;
  c2_nameCaptureInfo = NULL;
  c2_info_helper(c2_info);
  c2_b_info_helper(c2_info);
  sf_mex_assign(&c2_m0, sf_mex_createstruct("nameCaptureInfo", 1, 107));
  for (c2_i378 = 0; c2_i378 < 107; c2_i378 = c2_i378 + 1) {
    c2_r0 = &c2_info[c2_i378];
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->context, 15,
      0U, 0U, 0U, 2, 1, strlen(c2_r0->context)), "context",
                    "nameCaptureInfo", c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->name, 15, 0U,
      0U, 0U, 2, 1, strlen(c2_r0->name)), "name",
                    "nameCaptureInfo", c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->dominantType,
      15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->dominantType)),
                    "dominantType", "nameCaptureInfo", c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->resolved, 15,
      0U, 0U, 0U, 2, 1, strlen(c2_r0->resolved)), "resolved"
                    , "nameCaptureInfo", c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileLength,
      7, 0U, 0U, 0U, 0), "fileLength", "nameCaptureInfo",
                    c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTime1, 7,
      0U, 0U, 0U, 0), "fileTime1", "nameCaptureInfo",
                    c2_i378);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTime2, 7,
      0U, 0U, 0U, 0), "fileTime2", "nameCaptureInfo",
                    c2_i378);
  }

  sf_mex_assign(&c2_nameCaptureInfo, c2_m0);
  return c2_nameCaptureInfo;
}

static void c2_info_helper(c2_ResolvedFunctionInfo c2_info[107])
{
  c2_info[0].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[0].name = "isempty";
  c2_info[0].dominantType = "double";
  c2_info[0].resolved = "[B]isempty";
  c2_info[0].fileLength = 0U;
  c2_info[0].fileTime1 = 0U;
  c2_info[0].fileTime2 = 0U;
  c2_info[1].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/sqrt.m";
  c2_info[1].name = "eml_scalar_sqrt";
  c2_info[1].dominantType = "double";
  c2_info[1].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_sqrt.m";
  c2_info[1].fileLength = 664U;
  c2_info[1].fileTime1 = 1209330794U;
  c2_info[1].fileTime2 = 0U;
  c2_info[2].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[2].name = "and";
  c2_info[2].dominantType = "logical";
  c2_info[2].resolved = "[B]and";
  c2_info[2].fileLength = 0U;
  c2_info[2].fileTime1 = 0U;
  c2_info[2].fileTime2 = 0U;
  c2_info[3].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xnrm2.m";
  c2_info[3].name = "times";
  c2_info[3].dominantType = "double";
  c2_info[3].resolved = "[B]times";
  c2_info[3].fileLength = 0U;
  c2_info[3].fileTime1 = 0U;
  c2_info[3].fileTime2 = 0U;
  c2_info[4].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xnrm2.m";
  c2_info[4].name = "imag";
  c2_info[4].dominantType = "double";
  c2_info[4].resolved = "[B]imag";
  c2_info[4].fileLength = 0U;
  c2_info[4].fileTime1 = 0U;
  c2_info[4].fileTime2 = 0U;
  c2_info[5].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[5].name = "eml_scalar_floor";
  c2_info[5].dominantType = "double";
  c2_info[5].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m";
  c2_info[5].fileLength = 260U;
  c2_info[5].fileTime1 = 1209330790U;
  c2_info[5].fileTime2 = 0U;
  c2_info[6].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[6].name = "isfinite";
  c2_info[6].dominantType = "double";
  c2_info[6].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[6].fileLength = 341U;
  c2_info[6].fileTime1 = 1192466734U;
  c2_info[6].fileTime2 = 0U;
  c2_info[7].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m";
  c2_info[7].name = "eml_min_or_max";
  c2_info[7].dominantType = "int32";
  c2_info[7].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c2_info[7].fileLength = 7562U;
  c2_info[7].fileTime1 = 1213637686U;
  c2_info[7].fileTime2 = 0U;
  c2_info[8].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m";
  c2_info[8].name = "eml_blas_xgemm";
  c2_info[8].dominantType = "int32";
  c2_info[8].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xgemm.m";
  c2_info[8].fileLength = 355U;
  c2_info[8].fileTime1 = 1192466854U;
  c2_info[8].fileTime2 = 0U;
  c2_info[9].context = "";
  c2_info[9].name = "ctranspose";
  c2_info[9].dominantType = "double";
  c2_info[9].resolved = "[B]ctranspose";
  c2_info[9].fileLength = 0U;
  c2_info[9].fileTime1 = 0U;
  c2_info[9].fileTime2 = 0U;
  c2_info[10].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[10].name = "isscalar";
  c2_info[10].dominantType = "logical";
  c2_info[10].resolved = "[B]isscalar";
  c2_info[10].fileLength = 0U;
  c2_info[10].fileTime1 = 0U;
  c2_info[10].fileTime2 = 0U;
  c2_info[11].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[11].name = "ndims";
  c2_info[11].dominantType = "double";
  c2_info[11].resolved = "[B]ndims";
  c2_info[11].fileLength = 0U;
  c2_info[11].fileTime1 = 0U;
  c2_info[11].fileTime2 = 0U;
  c2_info[12].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.m";
  c2_info[12].name = "rdivide";
  c2_info[12].dominantType = "double";
  c2_info[12].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c2_info[12].fileLength = 620U;
  c2_info[12].fileTime1 = 1213637690U;
  c2_info[12].fileTime2 = 0U;
  c2_info[13].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[13].name = "eml_index_minus";
  c2_info[13].dominantType = "int32";
  c2_info[13].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m";
  c2_info[13].fileLength = 277U;
  c2_info[13].fileTime1 = 1192466784U;
  c2_info[13].fileTime2 = 0U;
  c2_info[14].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[14].name = "nargin";
  c2_info[14].dominantType = "";
  c2_info[14].resolved = "[B]nargin";
  c2_info[14].fileLength = 0U;
  c2_info[14].fileTime1 = 0U;
  c2_info[14].fileTime2 = 0U;
  c2_info[15].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[15].name = "eml_nonsingleton_dim";
  c2_info[15].dominantType = "logical";
  c2_info[15].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_nonsingleton_dim.m";
  c2_info[15].fileLength = 404U;
  c2_info[15].fileTime1 = 1192466800U;
  c2_info[15].fileTime2 = 0U;
  c2_info[16].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[16].name = "isstruct";
  c2_info[16].dominantType = "double";
  c2_info[16].resolved = "[B]isstruct";
  c2_info[16].fileLength = 0U;
  c2_info[16].fileTime1 = 0U;
  c2_info[16].fileTime2 = 0U;
  c2_info[17].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xaxpy.m";
  c2_info[17].name = "eml_refblas_xaxpy";
  c2_info[17].dominantType = "int32";
  c2_info[17].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xaxpy.m";
  c2_info[17].fileLength = 1440U;
  c2_info[17].fileTime1 = 1195314398U;
  c2_info[17].fileTime2 = 0U;
  c2_info[18].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[18].name = "not";
  c2_info[18].dominantType = "logical";
  c2_info[18].resolved = "[B]not";
  c2_info[18].fileLength = 0U;
  c2_info[18].fileTime1 = 0U;
  c2_info[18].fileTime2 = 0U;
  c2_info[19].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[19].name = "isvector";
  c2_info[19].dominantType = "double";
  c2_info[19].resolved = "[B]isvector";
  c2_info[19].fileLength = 0U;
  c2_info[19].fileTime1 = 0U;
  c2_info[19].fileTime2 = 0U;
  c2_info[20].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c2_info[20].name = "strcmp";
  c2_info[20].dominantType = "char";
  c2_info[20].resolved = "[B]strcmp";
  c2_info[20].fileLength = 0U;
  c2_info[20].fileTime1 = 0U;
  c2_info[20].fileTime2 = 0U;
  c2_info[21].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[21].name = "eml_error";
  c2_info[21].dominantType = "char";
  c2_info[21].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c2_info[21].fileLength = 315U;
  c2_info[21].fileTime1 = 1213637686U;
  c2_info[21].fileTime2 = 0U;
  c2_info[22].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xrotg.m";
  c2_info[22].name = "mrdivide";
  c2_info[22].dominantType = "double";
  c2_info[22].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.m";
  c2_info[22].fileLength = 755U;
  c2_info[22].fileTime1 = 1209330882U;
  c2_info[22].fileTime2 = 0U;
  c2_info[23].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xnrm2.m";
  c2_info[23].name = "real";
  c2_info[23].dominantType = "double";
  c2_info[23].resolved = "[B]real";
  c2_info[23].fileLength = 0U;
  c2_info[23].fileTime1 = 0U;
  c2_info[23].fileTime2 = 0U;
  c2_info[24].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xaxpy.m";
  c2_info[24].name = "eml_blas_xaxpy";
  c2_info[24].dominantType = "int32";
  c2_info[24].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xaxpy.m";
  c2_info[24].fileLength = 243U;
  c2_info[24].fileTime1 = 1192466850U;
  c2_info[24].fileTime2 = 0U;
  c2_info[25].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[25].name = "eml_zeros";
  c2_info[25].dominantType = "int32";
  c2_info[25].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_zeros.m";
  c2_info[25].fileLength = 1083U;
  c2_info[25].fileTime1 = 1213637688U;
  c2_info[25].fileTime2 = 0U;
  c2_info[26].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[26].name = "inf";
  c2_info[26].dominantType = "";
  c2_info[26].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/inf.m";
  c2_info[26].fileLength = 474U;
  c2_info[26].fileTime1 = 1192466728U;
  c2_info[26].fileTime2 = 0U;
  c2_info[27].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xdot.m";
  c2_info[27].name = "eml_refblas_xdot";
  c2_info[27].dominantType = "int32";
  c2_info[27].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdot.m";
  c2_info[27].fileLength = 343U;
  c2_info[27].fileTime1 = 1210870656U;
  c2_info[27].fileTime2 = 0U;
  c2_info[28].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[28].name = "assert";
  c2_info[28].dominantType = "char";
  c2_info[28].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[28].fileLength = 2684U;
  c2_info[28].fileTime1 = 1210870656U;
  c2_info[28].fileTime2 = 0U;
  c2_info[29].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/isintegral";
  c2_info[29].name = "true";
  c2_info[29].dominantType = "";
  c2_info[29].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/true.m";
  c2_info[29].fileLength = 237U;
  c2_info[29].fileTime1 = 1192466762U;
  c2_info[29].fileTime2 = 0U;
  c2_info[30].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[30].name = "lt";
  c2_info[30].dominantType = "double";
  c2_info[30].resolved = "[B]lt";
  c2_info[30].fileLength = 0U;
  c2_info[30].fileTime1 = 0U;
  c2_info[30].fileTime2 = 0U;
  c2_info[31].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m";
  c2_info[31].name = "zeros";
  c2_info[31].dominantType = "double";
  c2_info[31].resolved = "[B]zeros";
  c2_info[31].fileLength = 0U;
  c2_info[31].fileTime1 = 0U;
  c2_info[31].fileTime2 = 0U;
  c2_info[32].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[32].name = "eml_xaxpy";
  c2_info[32].dominantType = "int32";
  c2_info[32].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xaxpy.m";
  c2_info[32].fileLength = 1880U;
  c2_info[32].fileTime1 = 1209330846U;
  c2_info[32].fileTime2 = 0U;
  c2_info[33].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/numel_for_size";
  c2_info[33].name = "double";
  c2_info[33].dominantType = "int32";
  c2_info[33].resolved = "[B]double";
  c2_info[33].fileLength = 0U;
  c2_info[33].fileTime1 = 0U;
  c2_info[33].fileTime2 = 0U;
  c2_info[34].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[34].name = "ge";
  c2_info[34].dominantType = "double";
  c2_info[34].resolved = "[B]ge";
  c2_info[34].fileLength = 0U;
  c2_info[34].fileTime1 = 0U;
  c2_info[34].fileTime2 = 0U;
  c2_info[35].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[35].name = "islogical";
  c2_info[35].dominantType = "logical";
  c2_info[35].resolved = "[B]islogical";
  c2_info[35].fileLength = 0U;
  c2_info[35].fileTime1 = 0U;
  c2_info[35].fileTime2 = 0U;
  c2_info[36].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[36].name = "isinf";
  c2_info[36].dominantType = "double";
  c2_info[36].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isinf.m";
  c2_info[36].fileLength = 472U;
  c2_info[36].fileTime1 = 1192466734U;
  c2_info[36].fileTime2 = 0U;
  c2_info[37].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/true.m";
  c2_info[37].name = "logical";
  c2_info[37].dominantType = "double";
  c2_info[37].resolved = "[B]logical";
  c2_info[37].fileLength = 0U;
  c2_info[37].fileTime1 = 0U;
  c2_info[37].fileTime2 = 0U;
  c2_info[38].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m/eml_bin_extremum";
  c2_info[38].name = "eml_scalexp_size";
  c2_info[38].dominantType = "int32";
  c2_info[38].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_size.m";
  c2_info[38].fileLength = 1373U;
  c2_info[38].fileTime1 = 1208180060U;
  c2_info[38].fileTime2 = 0U;
  c2_info[39].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[39].name = "gt";
  c2_info[39].dominantType = "double";
  c2_info[39].resolved = "[B]gt";
  c2_info[39].fileLength = 0U;
  c2_info[39].fileTime1 = 0U;
  c2_info[39].fileTime2 = 0U;
  c2_info[40].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[40].name = "nargout";
  c2_info[40].dominantType = "";
  c2_info[40].resolved = "[B]nargout";
  c2_info[40].fileLength = 0U;
  c2_info[40].fileTime1 = 0U;
  c2_info[40].fileTime2 = 0U;
  c2_info[41].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[41].name = "abs";
  c2_info[41].dominantType = "double";
  c2_info[41].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m";
  c2_info[41].fileLength = 538U;
  c2_info[41].fileTime1 = 1203447928U;
  c2_info[41].fileTime2 = 0U;
  c2_info[42].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[42].name = "isa";
  c2_info[42].dominantType = "double";
  c2_info[42].resolved = "[B]isa";
  c2_info[42].fileLength = 0U;
  c2_info[42].fileTime1 = 0U;
  c2_info[42].fileTime2 = 0U;
  c2_info[43].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m/binary_isequal";
  c2_info[43].name = "all";
  c2_info[43].dominantType = "logical";
  c2_info[43].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
  c2_info[43].fileLength = 400U;
  c2_info[43].fileTime1 = 1192466904U;
  c2_info[43].fileTime2 = 0U;
  c2_info[44].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_zeros.m";
  c2_info[44].name = "eml_alloc";
  c2_info[44].dominantType = "int32";
  c2_info[44].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[44].fileLength = 2627U;
  c2_info[44].fileTime1 = 1213637686U;
  c2_info[44].fileTime2 = 0U;
  c2_info[45].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c2_info[45].name = "power";
  c2_info[45].dominantType = "double";
  c2_info[45].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[45].fileLength = 5131U;
  c2_info[45].fileTime1 = 1213637690U;
  c2_info[45].fileTime2 = 0U;
  c2_info[46].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xgemm.m";
  c2_info[46].name = "eml_refblas_xgemm";
  c2_info[46].dominantType = "int32";
  c2_info[46].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m";
  c2_info[46].fileLength = 5746U;
  c2_info[46].fileTime1 = 1210870658U;
  c2_info[46].fileTime2 = 0U;
  c2_info[47].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xrotg.m";
  c2_info[47].name = "eml_blas_xrotg";
  c2_info[47].dominantType = "double";
  c2_info[47].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xrotg.m";
  c2_info[47].fileLength = 196U;
  c2_info[47].fileTime1 = 1192466862U;
  c2_info[47].fileTime2 = 0U;
  c2_info[48].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m/genpnorm";
  c2_info[48].name = "eml_guarded_inf";
  c2_info[48].dominantType = "char";
  c2_info[48].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_guarded_inf.m";
  c2_info[48].fileLength = 495U;
  c2_info[48].fileTime1 = 1192466778U;
  c2_info[48].fileTime2 = 0U;
  c2_info[49].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m/genpnorm";
  c2_info[49].name = "eml_guarded_nan";
  c2_info[49].dominantType = "char";
  c2_info[49].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_guarded_nan.m";
  c2_info[49].fileLength = 485U;
  c2_info[49].fileTime1 = 1192466780U;
  c2_info[49].fileTime2 = 0U;
  c2_info[50].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[50].name = "int32";
  c2_info[50].dominantType = "double";
  c2_info[50].resolved = "[B]int32";
  c2_info[50].fileLength = 0U;
  c2_info[50].fileTime1 = 0U;
  c2_info[50].fileTime2 = 0U;
  c2_info[51].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[51].name = "isnan";
  c2_info[51].dominantType = "double";
  c2_info[51].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isnan.m";
  c2_info[51].fileLength = 472U;
  c2_info[51].fileTime1 = 1192466736U;
  c2_info[51].fileTime2 = 0U;
  c2_info[52].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdot.m";
  c2_info[52].name = "eml_blas_xdot";
  c2_info[52].dominantType = "int32";
  c2_info[52].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xdot.m";
  c2_info[52].fileLength = 238U;
  c2_info[52].fileTime1 = 1192466852U;
  c2_info[52].fileTime2 = 0U;
  c2_info[53].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_size.m";
  c2_info[53].name = "eml_scalexp_compatible";
  c2_info[53].dominantType = "int32";
  c2_info[53].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_compatible.m";
  c2_info[53].fileLength = 502U;
  c2_info[53].fileTime1 = 1208180058U;
  c2_info[53].fileTime2 = 0U;
  c2_info[54].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[54].name = "cast";
  c2_info[54].dominantType = "double";
  c2_info[54].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[54].fileLength = 866U;
  c2_info[54].fileTime1 = 1192466644U;
  c2_info[54].fileTime2 = 0U;
  c2_info[55].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_guarded_nan.m";
  c2_info[55].name = "nan";
  c2_info[55].dominantType = "char";
  c2_info[55].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/nan.m";
  c2_info[55].fileLength = 474U;
  c2_info[55].fileTime1 = 1192466744U;
  c2_info[55].fileTime2 = 0U;
  c2_info[56].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c2_info[56].name = "eml_isequal_core";
  c2_info[56].dominantType = "char";
  c2_info[56].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c2_info[56].fileLength = 3543U;
  c2_info[56].fileTime1 = 1213637686U;
  c2_info[56].fileTime2 = 0U;
  c2_info[57].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/false.m";
  c2_info[57].name = "eml_varargin_to_size";
  c2_info[57].dominantType = "double";
  c2_info[57].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_varargin_to_size.m";
  c2_info[57].fileLength = 630U;
  c2_info[57].fileTime1 = 1209330844U;
  c2_info[57].fileTime2 = 0U;
  c2_info[58].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m/zerosum";
  c2_info[58].name = "plus";
  c2_info[58].dominantType = "int32";
  c2_info[58].resolved = "[B]plus";
  c2_info[58].fileLength = 0U;
  c2_info[58].fileTime1 = 0U;
  c2_info[58].fileTime2 = 0U;
  c2_info[59].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c2_info[59].name = "eml_warning";
  c2_info[59].dominantType = "char";
  c2_info[59].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_warning.m";
  c2_info[59].fileLength = 262U;
  c2_info[59].fileTime1 = 1213637688U;
  c2_info[59].fileTime2 = 0U;
  c2_info[60].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xnrm2.m";
  c2_info[60].name = "eml_blas_xnrm2";
  c2_info[60].dominantType = "int32";
  c2_info[60].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xnrm2.m";
  c2_info[60].fileLength = 202U;
  c2_info[60].fileTime1 = 1192466860U;
  c2_info[60].fileTime2 = 0U;
  c2_info[61].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[61].name = "eml_xrotg";
  c2_info[61].dominantType = "double";
  c2_info[61].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xrotg.m";
  c2_info[61].fileLength = 597U;
  c2_info[61].fileTime1 = 1209330860U;
  c2_info[61].fileTime2 = 0U;
  c2_info[62].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[62].name = "ne";
  c2_info[62].dominantType = "double";
  c2_info[62].resolved = "[B]ne";
  c2_info[62].fileLength = 0U;
  c2_info[62].fileTime1 = 0U;
  c2_info[62].fileTime2 = 0U;
  c2_info[63].context = "";
  c2_info[63].name = "norm";
  c2_info[63].dominantType = "double";
  c2_info[63].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[63].fileLength = 5123U;
  c2_info[63].fileTime1 = 1209330870U;
  c2_info[63].fileTime2 = 0U;
}

static void c2_b_info_helper(c2_ResolvedFunctionInfo c2_info[107])
{
  c2_info[64].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[64].name = "eml_index_times";
  c2_info[64].dominantType = "int32";
  c2_info[64].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_times.m";
  c2_info[64].fileLength = 280U;
  c2_info[64].fileTime1 = 1192466788U;
  c2_info[64].fileTime2 = 0U;
  c2_info[65].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[65].name = "intmax";
  c2_info[65].dominantType = "char";
  c2_info[65].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m";
  c2_info[65].fileLength = 1535U;
  c2_info[65].fileTime1 = 1192466728U;
  c2_info[65].fileTime2 = 0U;
  c2_info[66].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[66].name = "realmin";
  c2_info[66].dominantType = "char";
  c2_info[66].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/realmin.m";
  c2_info[66].fileLength = 475U;
  c2_info[66].fileTime1 = 1192466752U;
  c2_info[66].fileTime2 = 0U;
  c2_info[67].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[67].name = "le";
  c2_info[67].dominantType = "double";
  c2_info[67].resolved = "[B]le";
  c2_info[67].fileLength = 0U;
  c2_info[67].fileTime1 = 0U;
  c2_info[67].fileTime2 = 0U;
  c2_info[68].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[68].name = "eq";
  c2_info[68].dominantType = "double";
  c2_info[68].resolved = "[B]eq";
  c2_info[68].fileLength = 0U;
  c2_info[68].fileTime1 = 0U;
  c2_info[68].fileTime2 = 0U;
  c2_info[69].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
  c2_info[69].name = "eml_all_or_any";
  c2_info[69].dominantType = "char";
  c2_info[69].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[69].fileLength = 3423U;
  c2_info[69].fileTime1 = 1213637686U;
  c2_info[69].fileTime2 = 0U;
  c2_info[70].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/realmin.m";
  c2_info[70].name = "mpower";
  c2_info[70].dominantType = "double";
  c2_info[70].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c2_info[70].fileLength = 3547U;
  c2_info[70].fileTime1 = 1213637688U;
  c2_info[70].fileTime2 = 0U;
  c2_info[71].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_abs.m";
  c2_info[71].name = "isreal";
  c2_info[71].dominantType = "double";
  c2_info[71].resolved = "[B]isreal";
  c2_info[71].fileLength = 0U;
  c2_info[71].fileTime1 = 0U;
  c2_info[71].fileTime2 = 0U;
  c2_info[72].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[72].name = "max";
  c2_info[72].dominantType = "int32";
  c2_info[72].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c2_info[72].fileLength = 308U;
  c2_info[72].fileTime1 = 1192466630U;
  c2_info[72].fileTime2 = 0U;
  c2_info[73].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[73].name = "isequal";
  c2_info[73].dominantType = "char";
  c2_info[73].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c2_info[73].fileLength = 157U;
  c2_info[73].fileTime1 = 1210870646U;
  c2_info[73].fileTime2 = 0U;
  c2_info[74].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[74].name = "uminus";
  c2_info[74].dominantType = "double";
  c2_info[74].resolved = "[B]uminus";
  c2_info[74].fileLength = 0U;
  c2_info[74].fileTime1 = 0U;
  c2_info[74].fileTime2 = 0U;
  c2_info[75].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_abs.m";
  c2_info[75].name = "isinteger";
  c2_info[75].dominantType = "double";
  c2_info[75].resolved = "[B]isinteger";
  c2_info[75].fileLength = 0U;
  c2_info[75].fileTime1 = 0U;
  c2_info[75].fileTime2 = 0U;
  c2_info[76].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[76].name = "eml_xgemm";
  c2_info[76].dominantType = "int32";
  c2_info[76].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m";
  c2_info[76].fileLength = 3184U;
  c2_info[76].fileTime1 = 1209330852U;
  c2_info[76].fileTime2 = 0U;
  c2_info[77].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[77].name = "sqrt";
  c2_info[77].dominantType = "double";
  c2_info[77].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/sqrt.m";
  c2_info[77].fileLength = 572U;
  c2_info[77].fileTime1 = 1203448046U;
  c2_info[77].fileTime2 = 0U;
  c2_info[78].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[78].name = "svd";
  c2_info[78].dominantType = "double";
  c2_info[78].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[78].fileLength = 16495U;
  c2_info[78].fileTime1 = 1213637688U;
  c2_info[78].fileTime2 = 0U;
  c2_info[79].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdotc.m";
  c2_info[79].name = "eml_xdot";
  c2_info[79].dominantType = "int32";
  c2_info[79].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdot.m";
  c2_info[79].fileLength = 1330U;
  c2_info[79].fileTime1 = 1209330850U;
  c2_info[79].fileTime2 = 0U;
  c2_info[80].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[80].name = "eml_index_class";
  c2_info[80].dominantType = "";
  c2_info[80].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m";
  c2_info[80].fileLength = 909U;
  c2_info[80].fileTime1 = 1192466782U;
  c2_info[80].fileTime2 = 0U;
  c2_info[81].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[81].name = "eml_xnrm2";
  c2_info[81].dominantType = "int32";
  c2_info[81].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xnrm2.m";
  c2_info[81].fileLength = 718U;
  c2_info[81].fileTime1 = 1209330858U;
  c2_info[81].fileTime2 = 0U;
  c2_info[82].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xnrm2.m";
  c2_info[82].name = "eml_refblas_xnrm2";
  c2_info[82].dominantType = "int32";
  c2_info[82].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xnrm2.m";
  c2_info[82].fileLength = 1107U;
  c2_info[82].fileTime1 = 1195314402U;
  c2_info[82].fileTime2 = 0U;
  c2_info[83].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m";
  c2_info[83].name = "class";
  c2_info[83].dominantType = "double";
  c2_info[83].resolved = "[B]class";
  c2_info[83].fileLength = 0U;
  c2_info[83].fileTime1 = 0U;
  c2_info[83].fileTime2 = 0U;
  c2_info[84].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xscal.m";
  c2_info[84].name = "eml_blas_xscal";
  c2_info[84].dominantType = "int32";
  c2_info[84].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xscal.m";
  c2_info[84].fileLength = 209U;
  c2_info[84].fileTime1 = 1192466862U;
  c2_info[84].fileTime2 = 0U;
  c2_info[85].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[85].name = "eml_index_plus";
  c2_info[85].dominantType = "int32";
  c2_info[85].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m";
  c2_info[85].fileLength = 272U;
  c2_info[85].fileTime1 = 1192466786U;
  c2_info[85].fileTime2 = 0U;
  c2_info[86].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xscal.m";
  c2_info[86].name = "eml_refblas_xscal";
  c2_info[86].dominantType = "int32";
  c2_info[86].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xscal.m";
  c2_info[86].fileLength = 464U;
  c2_info[86].fileTime1 = 1195314406U;
  c2_info[86].fileTime2 = 0U;
  c2_info[87].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c2_info[87].name = "minus";
  c2_info[87].dominantType = "double";
  c2_info[87].resolved = "[B]minus";
  c2_info[87].fileLength = 0U;
  c2_info[87].fileTime1 = 0U;
  c2_info[87].fileTime2 = 0U;
  c2_info[88].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xrotg.m";
  c2_info[88].name = "eml_refblas_xrotg";
  c2_info[88].dominantType = "double";
  c2_info[88].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xrotg.m";
  c2_info[88].fileLength = 1282U;
  c2_info[88].fileTime1 = 1195314404U;
  c2_info[88].fileTime2 = 0U;
  c2_info[89].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[89].name = "eml_assert_valid_size_arg";
  c2_info[89].dominantType = "int32";
  c2_info[89].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[89].fileLength = 2835U;
  c2_info[89].fileTime1 = 1210870644U;
  c2_info[89].fileTime2 = 0U;
  c2_info[90].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[90].name = "eml_set_singleton_dim";
  c2_info[90].dominantType = "double";
  c2_info[90].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_set_singleton_dim.m";
  c2_info[90].fileLength = 398U;
  c2_info[90].fileTime1 = 1209330838U;
  c2_info[90].fileTime2 = 0U;
  c2_info[91].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m";
  c2_info[91].name = "size";
  c2_info[91].dominantType = "double";
  c2_info[91].resolved = "[B]size";
  c2_info[91].fileLength = 0U;
  c2_info[91].fileTime1 = 0U;
  c2_info[91].fileTime2 = 0U;
  c2_info[92].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[92].name = "eps";
  c2_info[92].dominantType = "char";
  c2_info[92].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/eps.m";
  c2_info[92].fileLength = 1342U;
  c2_info[92].fileTime1 = 1210870646U;
  c2_info[92].fileTime2 = 0U;
  c2_info[93].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/norm.m";
  c2_info[93].name = "ischar";
  c2_info[93].dominantType = "double";
  c2_info[93].resolved = "[B]ischar";
  c2_info[93].fileLength = 0U;
  c2_info[93].fileTime1 = 0U;
  c2_info[93].fileTime2 = 0U;
  c2_info[94].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[94].name = "isnumeric";
  c2_info[94].dominantType = "int32";
  c2_info[94].resolved = "[B]isnumeric";
  c2_info[94].fileLength = 0U;
  c2_info[94].fileTime1 = 0U;
  c2_info[94].fileTime2 = 0U;
  c2_info[95].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdot.m";
  c2_info[95].name = "eml_refblas_xdotx";
  c2_info[95].dominantType = "int32";
  c2_info[95].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[95].fileLength = 1786U;
  c2_info[95].fileTime1 = 1210870656U;
  c2_info[95].fileTime2 = 0U;
  c2_info[96].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[96].name = "eml_xdotc";
  c2_info[96].dominantType = "int32";
  c2_info[96].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdotc.m";
  c2_info[96].fileLength = 1453U;
  c2_info[96].fileTime1 = 1209330850U;
  c2_info[96].fileTime2 = 0U;
  c2_info[97].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/isintegral";
  c2_info[97].name = "false";
  c2_info[97].dominantType = "";
  c2_info[97].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/false.m";
  c2_info[97].fileLength = 238U;
  c2_info[97].fileTime1 = 1192466720U;
  c2_info[97].fileTime2 = 0U;
  c2_info[98].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m";
  c2_info[98].name = "eml_scalar_abs";
  c2_info[98].dominantType = "double";
  c2_info[98].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_abs.m";
  c2_info[98].fileLength = 461U;
  c2_info[98].fileTime1 = 1203447960U;
  c2_info[98].fileTime2 = 0U;
  c2_info[99].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[99].name = "ones";
  c2_info[99].dominantType = "char";
  c2_info[99].resolved = "[B]ones";
  c2_info[99].fileLength = 0U;
  c2_info[99].fileTime1 = 0U;
  c2_info[99].fileTime2 = 0U;
  c2_info[100].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[100].name = "eml_xscal";
  c2_info[100].dominantType = "int32";
  c2_info[100].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xscal.m";
  c2_info[100].fileLength = 1205U;
  c2_info[100].fileTime1 = 1209330860U;
  c2_info[100].fileTime2 = 0U;
  c2_info[101].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[101].name = "min";
  c2_info[101].dominantType = "int32";
  c2_info[101].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m";
  c2_info[101].fileLength = 308U;
  c2_info[101].fileTime1 = 1192466634U;
  c2_info[101].fileTime2 = 0U;
  c2_info[102].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[102].name = "eml_div";
  c2_info[102].dominantType = "double";
  c2_info[102].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m";
  c2_info[102].fileLength = 4254U;
  c2_info[102].fileTime1 = 1192466772U;
  c2_info[102].fileTime2 = 0U;
  c2_info[103].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/matfun/svd.m";
  c2_info[103].name = "conj";
  c2_info[103].dominantType = "double";
  c2_info[103].resolved = "[B]conj";
  c2_info[103].fileLength = 0U;
  c2_info[103].fileTime1 = 0U;
  c2_info[103].fileTime2 = 0U;
  c2_info[104].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[104].name = "eml_xdotu";
  c2_info[104].dominantType = "int32";
  c2_info[104].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdotu.m";
  c2_info[104].fileLength = 1453U;
  c2_info[104].fileTime1 = 1209330852U;
  c2_info[104].fileTime2 = 0U;
  c2_info[105].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/eps.m";
  c2_info[105].name = "eml_is_float_class";
  c2_info[105].dominantType = "char";
  c2_info[105].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_is_float_class.m";
  c2_info[105].fileLength = 226U;
  c2_info[105].fileTime1 = 1197850442U;
  c2_info[105].fileTime2 = 0U;
  c2_info[106].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/numel_for_size";
  c2_info[106].name = "mtimes";
  c2_info[106].dominantType = "double";
  c2_info[106].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[106].fileLength = 2336U;
  c2_info[106].fileTime1 = 1213637690U;
  c2_info[106].fileTime2 = 0U;
}

static void init_dsm_address_info(void)
{
}

/* SFunction Glue Code */
void sf_c2_kalman2_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3102928255U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2253151647U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1504772583U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(693608185U);
}

mxArray *sf_c2_kalman2_get_autoinheritance_info(void)
{
  const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
    "outputs" };

  mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,4,
    autoinheritanceFields);

  {
    mxArray *mxChecksum = mxCreateDoubleMatrix(4,1,mxREAL);
    double *pr = mxGetPr(mxChecksum);
    pr[0] = (double)(3504087840U);
    pr[1] = (double)(4229553029U);
    pr[2] = (double)(991681582U);
    pr[3] = (double)(609965172U);
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,12,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,2,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,2,"type",mxType);
    }

    mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(2);
      mxSetField(mxData,3,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,3,"type",mxType);
    }

    mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(3);
      mxSetField(mxData,4,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,4,"type",mxType);
    }

    mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,5,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,5,"type",mxType);
    }

    mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(2);
      mxSetField(mxData,6,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,6,"type",mxType);
    }

    mxSetField(mxData,6,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(2);
      pr[1] = (double)(2);
      mxSetField(mxData,7,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,7,"type",mxType);
    }

    mxSetField(mxData,7,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,8,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,8,"type",mxType);
    }

    mxSetField(mxData,8,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,9,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,9,"type",mxType);
    }

    mxSetField(mxData,9,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,10,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,10,"type",mxType);
    }

    mxSetField(mxData,10,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,11,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,11,"type",mxType);
    }

    mxSetField(mxData,11,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
  }

  {
    mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
                mxREAL));
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,2,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
  }

  return(mxAutoinheritanceInfo);
}

static void chart_debug_initialization(SimStruct *S, unsigned int
  fullDebuggerInitialization)
{
  if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
    /* do this only if simulation is starting */
    if (!sim_mode_is_rtw_gen(S)) {
      {
        unsigned int chartAlreadyPresent;
        chartAlreadyPresent = sf_debug_initialize_chart(_kalman2MachineNumber_,
          2,
          1,
          1,
          14,
          0,
          0,
          0,
          0,
          0,
          &(chartInstance.chartNumber),
          &(chartInstance.instanceNumber),
          ssGetPath(S),
          (void *)S);
        if (chartAlreadyPresent==0) {
          /* this is the first instance */
          init_script_number_translation(_kalman2MachineNumber_,
            chartInstance.chartNumber);
          sf_debug_set_chart_disable_implicit_casting(_kalman2MachineNumber_,
            chartInstance.chartNumber,1);
          sf_debug_set_chart_event_thresholds(_kalman2MachineNumber_,
            chartInstance.chartNumber,
            0,
            0,
            0);
          _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"u",0,
                              c2_sf_marshall);

          {
            unsigned int dimVector[1];
            dimVector[0]= 3;
            _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"xkplus1",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Phi",0,c2_b_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 1;
            _SFD_SET_DATA_PROPS(3,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Gamma",0,c2_c_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(4,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"G",0,c2_d_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 1;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(5,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"C",0,c2_e_sf_marshall);
          }

          _SFD_SET_DATA_PROPS(6,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"D",0,
                              NULL);

          {
            unsigned int dimVector[2];
            dimVector[0]= 1;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(7,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"H",0,c2_f_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 2;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(8,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Q",0,c2_g_sf_marshall);
          }

          _SFD_SET_DATA_PROPS(9,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"R",0,
                              NULL);

          {
            unsigned int dimVector[1];
            dimVector[0]= 3;
            _SFD_SET_DATA_PROPS(10,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"xk",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(11,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Pk",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(12,2,0,1,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Pkplus1",0,NULL);
          }

          _SFD_SET_DATA_PROPS(13,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"y",0,
                              NULL);
          _SFD_STATE_INFO(0,0,2);
          _SFD_CH_SUBSTATE_COUNT(0);
          _SFD_CH_SUBSTATE_DECOMP(0);
        }

        _SFD_CV_INIT_CHART(0,0,0,0);

        {
          _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
        }

        _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);

        /* Initialization of EML Model Coverage */
        _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0);
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,418);
        _SFD_CV_INIT_EML_IF(0,0,154,245,278,418);
        _SFD_TRANS_COV_WTS(0,0,0,1,0);
        if (chartAlreadyPresent==0) {
          _SFD_TRANS_COV_MAPS(0,
                              0,NULL,NULL,
                              0,NULL,NULL,
                              1,NULL,NULL,
                              0,NULL,NULL);
        }

        {
          real_T *c2_u;
          real_T (*c2_xkplus1)[3];
          real_T (*c2_Phi)[9];
          real_T (*c2_Gamma)[3];
          real_T (*c2_G)[6];
          real_T (*c2_C)[3];
          real_T *c2_D;
          real_T (*c2_H)[2];
          real_T (*c2_Q)[4];
          real_T *c2_R;
          real_T (*c2_xk)[3];
          real_T (*c2_Pk)[9];
          real_T (*c2_Pkplus1)[9];
          real_T *c2_y;
          c2_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
          c2_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
          c2_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
          c2_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
          c2_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
          c2_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
          c2_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
          c2_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
          c2_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
          c2_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
          c2_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
          c2_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
          c2_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
          c2_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
          _SFD_SET_DATA_VALUE_PTR(0U, c2_u);
          _SFD_SET_DATA_VALUE_PTR(1U, c2_xkplus1);
          _SFD_SET_DATA_VALUE_PTR(2U, c2_Phi);
          _SFD_SET_DATA_VALUE_PTR(3U, c2_Gamma);
          _SFD_SET_DATA_VALUE_PTR(4U, c2_G);
          _SFD_SET_DATA_VALUE_PTR(5U, c2_C);
          _SFD_SET_DATA_VALUE_PTR(6U, c2_D);
          _SFD_SET_DATA_VALUE_PTR(7U, c2_H);
          _SFD_SET_DATA_VALUE_PTR(8U, c2_Q);
          _SFD_SET_DATA_VALUE_PTR(9U, c2_R);
          _SFD_SET_DATA_VALUE_PTR(10U, c2_xk);
          _SFD_SET_DATA_VALUE_PTR(11U, c2_Pk);
          _SFD_SET_DATA_VALUE_PTR(12U, c2_Pkplus1);
          _SFD_SET_DATA_VALUE_PTR(13U, c2_y);
        }
      }
    }
  } else {
    sf_debug_reset_current_state_configuration(_kalman2MachineNumber_,
      chartInstance.chartNumber,chartInstance.instanceNumber);
  }
}

static void sf_opaque_initialize_c2_kalman2(void *chartInstanceVar)
{
  chart_debug_initialization(chartInstance.S,0);
  initialize_params_c2_kalman2();
  initialize_c2_kalman2();
}

static void sf_opaque_enable_c2_kalman2(void *chartInstanceVar)
{
  enable_c2_kalman2();
}

static void sf_opaque_disable_c2_kalman2(void *chartInstanceVar)
{
  disable_c2_kalman2();
}

static void sf_opaque_gateway_c2_kalman2(void *chartInstanceVar)
{
  sf_c2_kalman2();
}

static mxArray* sf_opaque_get_sim_state_c2_kalman2(void *chartInstanceVar)
{
  mxArray *st = (mxArray *) get_sim_state_c2_kalman2();
  return st;
}

static void sf_opaque_set_sim_state_c2_kalman2(void *chartInstanceVar, const
  mxArray *st)
{
  set_sim_state_c2_kalman2(sf_mex_dup(st));
}

static void sf_opaque_terminate_c2_kalman2(void *chartInstanceVar)
{
  if (sim_mode_is_rtw_gen(chartInstance.S) || sim_mode_is_external
      (chartInstance.S)) {
    sf_clear_rtw_identifier(chartInstance.S);
  }

  finalize_c2_kalman2();
}

extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c2_kalman2(SimStruct *S)
{
  int i;
  for (i=0;i<ssGetNumRunTimeParams(S);i++) {
    if (ssGetSFcnParamTunable(S,i)) {
      ssUpdateDlgParamAsRunTimeParam(S,i);
    }
  }

  if (sf_machine_global_initializer_called()) {
    initialize_params_c2_kalman2();
  }
}

static void mdlSetWorkWidths_c2_kalman2(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable("kalman2","kalman2",2);
    ssSetStateflowIsInlinable(S,chartIsInlinable);
    ssSetRTWCG(S,sf_rtw_info_uint_prop("kalman2","kalman2",2,"RTWCG"));
    ssSetEnableFcnIsTrivial(S,1);
    ssSetDisableFcnIsTrivial(S,1);
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("kalman2","kalman2",2,
      "gatewayCannotBeInlinedMultipleTimes"));
    if (chartIsInlinable) {
      ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 3, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 4, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 5, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 6, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 7, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 8, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 9, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 10, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 11, SS_REUSABLE_AND_LOCAL);
      sf_mark_chart_expressionable_inputs(S,"kalman2","kalman2",2,12);
      sf_mark_chart_reusable_outputs(S,"kalman2","kalman2",2,2);
    }

    sf_set_rtw_dwork_info(S,"kalman2","kalman2",2);
    ssSetHasSubFunctions(S,!(chartIsInlinable));
    ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
  }

  ssSetChecksum0(S,(3338505170U));
  ssSetChecksum1(S,(383393129U));
  ssSetChecksum2(S,(3972476648U));
  ssSetChecksum3(S,(2503399227U));
  ssSetmdlDerivatives(S, NULL);
  ssSetExplicitFCSSCtrl(S,1);
}

static void mdlRTW_c2_kalman2(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S)) {
    sf_write_symbol_mapping(S, "kalman2", "kalman2",2);
    ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
  }
}

static void mdlStart_c2_kalman2(SimStruct *S)
{
  chartInstance.chartInfo.chartInstance = NULL;
  chartInstance.chartInfo.isEMLChart = 1;
  chartInstance.chartInfo.chartInitialized = 0;
  chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c2_kalman2;
  chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c2_kalman2;
  chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c2_kalman2;
  chartInstance.chartInfo.enableChart = sf_opaque_enable_c2_kalman2;
  chartInstance.chartInfo.disableChart = sf_opaque_disable_c2_kalman2;
  chartInstance.chartInfo.getSimState = sf_opaque_get_sim_state_c2_kalman2;
  chartInstance.chartInfo.setSimState = sf_opaque_set_sim_state_c2_kalman2;
  chartInstance.chartInfo.zeroCrossings = NULL;
  chartInstance.chartInfo.outputs = NULL;
  chartInstance.chartInfo.derivatives = NULL;
  chartInstance.chartInfo.mdlRTW = mdlRTW_c2_kalman2;
  chartInstance.chartInfo.mdlStart = mdlStart_c2_kalman2;
  chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c2_kalman2;
  chartInstance.chartInfo.extModeExec = NULL;
  chartInstance.chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.storeCurrentConfiguration = NULL;
  chartInstance.S = S;
  ssSetUserData(S,(void *)(&(chartInstance.chartInfo)));/* register the chart instance with simstruct */
  if (!sim_mode_is_rtw_gen(S)) {
    init_dsm_address_info();
  }

  chart_debug_initialization(S,1);
}

void c2_kalman2_method_dispatcher(SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c2_kalman2(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c2_kalman2(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c2_kalman2(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c2_kalman2_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}
